diff --git a/pgweb/util/misc.py b/pgweb/util/misc.py index 89deb60a..364af5f4 100644 --- a/pgweb/util/misc.py +++ b/pgweb/util/misc.py @@ -9,8 +9,12 @@ from pgweb.util.helpers import template_to_string import re 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, - template_to_string(templatename, templateattr), + template_to_string(templatename, d), usergenerated=usergenerated, cc=cc, replyto=replyto, receivername=receivername, sendername=sendername) diff --git a/templates/account/email_change_email.txt b/templates/account/email_change_email.txt index 75546cb2..8622c6ab 100644 --- a/templates/account/email_change_email.txt +++ b/templates/account/email_change_email.txt @@ -4,5 +4,5 @@ PostgreSQL community account {{user.username}} to this email address. To confirm this change of email address, please click the following link: -https://www.postgresql.org/account/profile/change_email/{{token.token}}/ +{{link_root}}/account/profile/change_email/{{token.token}}/ diff --git a/templates/account/new_account_email.txt b/templates/account/new_account_email.txt index 876f530c..53d89c14 100644 --- a/templates/account/new_account_email.txt +++ b/templates/account/new_account_email.txt @@ -3,6 +3,6 @@ PostgreSQL community account. 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}}. diff --git a/templates/account/password_reset_email.txt b/templates/account/password_reset_email.txt index e5ee92f9..66650717 100644 --- a/templates/account/password_reset_email.txt +++ b/templates/account/password_reset_email.txt @@ -3,7 +3,7 @@ PostgreSQL community account. 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}}. diff --git a/templates/core/moderation_report.txt b/templates/core/moderation_report.txt index b80ed3b2..f917155b 100644 --- a/templates/core/moderation_report.txt +++ b/templates/core/moderation_report.txt @@ -5,4 +5,4 @@ The following items are currently pending moderation: Moderators; please check and moderate these items as soon as possible! -https://www.postgresql.org/admin/pending/ +{{link_root}}/admin/pending/