Commit a30de002 by Őry Máté

dashboard: add EMAIL_SUBJECT_PREFIX to notifications

parent 8bc53a3b
......@@ -79,6 +79,8 @@ ADMINS = (
('Root', 'root@localhost'),
)
EMAIL_SUBJECT_PREFIX = get_env_variable('DJANGO_SUBJECT_PREFIX', '[CIRCLE] ')
# See: https://docs.djangoproject.com/en/dev/ref/settings/#managers
MANAGERS = ADMINS
########## END MANAGER CONFIGURATION
......
......@@ -86,7 +86,7 @@ class Profile(Model):
use_gravatar = BooleanField(default=False)
email_notifications = BooleanField(
verbose_name=_("Email notifications"), default=True,
help_text=_('Wether user wants to get digested email notifications.'))
help_text=_('Whether user wants to get digested email notifications.'))
def notify(self, subject, template, context={}, valid_until=None):
return Notification.send(self.user, subject, template, context,
......
......@@ -51,7 +51,8 @@ def send_email_notifications():
'url': (settings.DJANGO_URL.rstrip("/") +
reverse("dashboard.views.notifications")),
'site': settings.COMPANY_NAME}
subject = ungettext("%d new notification",
subject = settings.EMAIL_SUBJECT_PREFIX + ungettext(
"%d new notification",
"%d new notifications", len(msgs)) % len(msgs)
body = render_to_string('dashboard/notifications/email.txt',
context)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment