Prefix notification emails with the event slug

This commit is contained in:
Raphael Michel
2019-05-16 11:09:20 +02:00
parent 5f82db3949
commit 6c582b8f8c
3 changed files with 7 additions and 2 deletions

View File

@@ -104,7 +104,11 @@ def send_notification_mail(notification: Notification, user: User):
mail_send_task.apply_async(kwargs={
'to': [user.email],
'subject': '[{}] {}'.format(settings.PRETIX_INSTANCE_NAME, notification.title),
'subject': '[{}] {}: {}'.format(
settings.PRETIX_INSTANCE_NAME,
notification.event.settings.mail_prefix or notification.event.slug.upper(),
notification.title
),
'body': body_plain,
'html': body_html,
'sender': settings.MAIL_FROM,