Change From for todo.sr.ht emails
This commit is contained in:
parent
66c22baf60
commit
010005e5b7
|
@ -50,6 +50,9 @@ connection-string=postgresql://postgres@localhost/todo.sr.ht
|
|||
# Register your client at meta.example.org/oauth
|
||||
oauth-client-id=CHANGEME
|
||||
oauth-client-secret=CHANGEME
|
||||
#
|
||||
# Value of From header in notification emails
|
||||
notify-from=CHANGEME
|
||||
|
||||
[meta.sr.ht]
|
||||
origin=http://meta.sr.ht.local
|
||||
|
|
|
@ -18,6 +18,7 @@ from datetime import datetime
|
|||
ticket = Blueprint("ticket", __name__)
|
||||
|
||||
smtp_user = cfg("mail", "smtp-user", default=None)
|
||||
notify_from = cfg("todo.sr.ht", "notify-from", default=None)
|
||||
|
||||
@ticket.route("/<owner>/<name>/<int:ticket_id>")
|
||||
def ticket_GET(owner, name, ticket_id):
|
||||
|
@ -194,10 +195,8 @@ def ticket_comment_POST(owner, name, ticket_id):
|
|||
tracker.owner.canonical_name(), tracker.name,
|
||||
ticket.scoped_id, ticket.title),
|
||||
headers={
|
||||
"From": "{} <{}>".format(
|
||||
current_user.username,
|
||||
current_user.email),
|
||||
"Sender": smtp_user
|
||||
"From": notify_from,
|
||||
"Sender": smtp_user,
|
||||
},
|
||||
ticket=ticket,
|
||||
comment=comment,
|
||||
|
|
|
@ -20,6 +20,7 @@ tracker = Blueprint("tracker", __name__)
|
|||
name_re = re.compile(r"^([a-z][a-z0-9_.-]*?)+$")
|
||||
|
||||
smtp_user = cfg("mail", "smtp-user", default=None)
|
||||
notify_from = cfg("todo.sr.ht", "notify-from", default=None)
|
||||
|
||||
@tracker.route("/tracker/create")
|
||||
@loginrequired
|
||||
|
@ -325,9 +326,8 @@ def tracker_submit_POST(owner, name):
|
|||
tracker.owner.canonical_name(), tracker.name,
|
||||
ticket.scoped_id, ticket.title),
|
||||
headers={
|
||||
"From": "{} <{}>".format(current_user.username,
|
||||
current_user.email),
|
||||
"Sender": smtp_user
|
||||
"From": notify_from,
|
||||
"Sender": smtp_user,
|
||||
}, ticket=ticket,
|
||||
ticket_url=ticket_url.replace("%7E", "~")) # hack
|
||||
|
||||
|
|
Loading…
Reference in New Issue