diff --git a/mayan/apps/mailer/forms.py b/mayan/apps/mailer/forms.py index d63b60d344..cb1dfcb422 100644 --- a/mayan/apps/mailer/forms.py +++ b/mayan/apps/mailer/forms.py @@ -1,6 +1,7 @@ from __future__ import unicode_literals from django import forms +from django.conf import settings from django.utils.translation import ugettext_lazy as _ from .settings import ( @@ -15,11 +16,16 @@ class DocumentMailForm(forms.Form): super(DocumentMailForm, self).__init__(*args, **kwargs) if as_attachment: self.fields['subject'].initial = setting_document_subject_template.value - self.fields['body'].initial = setting_document_body_template.value + self.fields['body'].initial = setting_document_body_template.value % { + 'project_title': settings.PROJECT_TITLE, + 'project_website': settings.PROJECT_WEBSITE + } else: self.fields['subject'].initial = setting_link_subject_template.value - self.fields['body'].initial = setting_link_body_template.value - + self.fields['body'].initial = setting_link_body_template.value % { + 'project_title': settings.PROJECT_TITLE, + 'project_website': settings.PROJECT_WEBSITE + } email = forms.EmailField(label=_('Email address')) subject = forms.CharField(label=_('Subject'), required=False) body = forms.CharField( diff --git a/mayan/apps/mailer/literals.py b/mayan/apps/mailer/literals.py index 9f703ec3f6..d7940ba4ad 100644 --- a/mayan/apps/mailer/literals.py +++ b/mayan/apps/mailer/literals.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from django.conf import settings from django.utils.translation import ugettext_lazy as _ @@ -8,16 +7,10 @@ DEFAULT_DOCUMENT_BODY_TEMPLATE = _( 'Attached to this email is the document: {{ document }}\n\n ' '--------\n ' 'This email has been sent from %(project_title)s (%(project_website)s)' -) % { - 'project_title': settings.PROJECT_TITLE, - 'project_website': settings.PROJECT_WEBSITE -} +) DEFAULT_LINK_BODY_TEMPLATE = _( 'To access this document click on the following link: ' '{{ link }}\n\n--------\n ' 'This email has been sent from %(project_title)s (%(project_website)s)' -) % { - 'project_title': settings.PROJECT_TITLE, - 'project_website': settings.PROJECT_WEBSITE -} +)