Skip to content

Commit 85054dc

Browse files
committed
Use EMAIL_SUBJECT_PREFIX if set.
1 parent e3c0136 commit 85054dc

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

docker/prod/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ SECRET_KEY="changeme"
44
PRIMARY_HOST="https://test.hypha.app"
55
EMAIL_HOST="hypha.app"
66

7-
EMAIL_SUBJECT_PREFIX="[Hypha]"
7+
EMAIL_SUBJECT_PREFIX="[Hypha] "
88
ORG_EMAIL="hello@hypha.app"
99
SERVER_EMAIL="test@hypha.app"
1010

hypha/apply/users/signals.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,14 @@ def send_login_notification(sender, request, user, **kwargs):
1313
if not settings.SEND_MESSAGES or not user.email:
1414
return
1515

16+
subject = _("Successful login to %(org)s") % {"org": settings.ORG_LONG_NAME}
17+
if settings.EMAIL_SUBJECT_PREFIX:
18+
subject = str(settings.EMAIL_SUBJECT_PREFIX) + str(subject)
19+
1620
email = MarkdownMail("users/emails/login_notification.md")
1721
email.send(
1822
to=user.email,
19-
subject=_("Successful login to %(org)s") % {"org": settings.ORG_LONG_NAME},
23+
subject=subject,
2024
from_email=settings.DEFAULT_FROM_EMAIL,
2125
context={
2226
"user": user,

0 commit comments

Comments
 (0)