mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-06 09:57:57 +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
|
||||
|
||||
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)
|
||||
|
||||
|
Reference in New Issue
Block a user