mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-10 00:42:06 +00:00
Include link_root in mail templates, and use
Instead of hardcoding www.postgresql.org, include the link_root variable the same way we do in the global context when rendering pages, and use that from the mail templates. Makes for a lot smoother workings in test environments.
This commit is contained in:
@ -9,8 +9,12 @@ from pgweb.util.helpers import template_to_string
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
def send_template_mail(sender, receiver, subject, templatename, templateattr={}, usergenerated=False, cc=None, replyto=None, receivername=None, sendername=None):
|
def send_template_mail(sender, receiver, subject, templatename, templateattr={}, usergenerated=False, cc=None, replyto=None, receivername=None, sendername=None):
|
||||||
|
d = {
|
||||||
|
'link_root': settings.SITE_ROOT,
|
||||||
|
}
|
||||||
|
d.update(templateattr)
|
||||||
send_simple_mail(sender, receiver, subject,
|
send_simple_mail(sender, receiver, subject,
|
||||||
template_to_string(templatename, templateattr),
|
template_to_string(templatename, d),
|
||||||
usergenerated=usergenerated, cc=cc, replyto=replyto,
|
usergenerated=usergenerated, cc=cc, replyto=replyto,
|
||||||
receivername=receivername, sendername=sendername)
|
receivername=receivername, sendername=sendername)
|
||||||
|
|
||||||
|
@ -4,5 +4,5 @@ PostgreSQL community account {{user.username}} to this email address.
|
|||||||
To confirm this change of email address, please click the following
|
To confirm this change of email address, please click the following
|
||||||
link:
|
link:
|
||||||
|
|
||||||
https://www.postgresql.org/account/profile/change_email/{{token.token}}/
|
{{link_root}}/account/profile/change_email/{{token.token}}/
|
||||||
|
|
||||||
|
@ -3,6 +3,6 @@ PostgreSQL community account.
|
|||||||
|
|
||||||
Please go to the following page and choose a new password:
|
Please go to the following page and choose a new password:
|
||||||
|
|
||||||
https://www.postgresql.org/account/reset/{{uid}}-{{token}}/
|
{{link_root}}/account/reset/{{uid}}-{{token}}/
|
||||||
|
|
||||||
Your username, in case you've forgotten, is {{user.username}}.
|
Your username, in case you've forgotten, is {{user.username}}.
|
||||||
|
@ -3,7 +3,7 @@ PostgreSQL community account.
|
|||||||
|
|
||||||
Please go to the following page and choose a new password:
|
Please go to the following page and choose a new password:
|
||||||
|
|
||||||
https://www.postgresql.org/account/reset/{{uid}}-{{token}}/
|
{{link_root}}/account/reset/{{uid}}-{{token}}/
|
||||||
|
|
||||||
Your username, in case you've forgotten, is {{user.username}}.
|
Your username, in case you've forgotten, is {{user.username}}.
|
||||||
|
|
||||||
|
@ -5,4 +5,4 @@ The following items are currently pending moderation:
|
|||||||
|
|
||||||
Moderators; please check and moderate these items as soon as possible!
|
Moderators; please check and moderate these items as soon as possible!
|
||||||
|
|
||||||
https://www.postgresql.org/admin/pending/
|
{{link_root}}/admin/pending/
|
||||||
|
Reference in New Issue
Block a user