allan
March 10, 2022, 11:45am
1
Hi.
I see in the code there is the possibility of setting a prefix for notification subject emails.
Does this work already?
I set the env variable but cant see the prefix in notification emails.
I cant see it impremented in the code nor could I find any issues/PRs on github.
Any advice @frjo ?
thanks allan
frjo
March 10, 2022, 12:09pm
2
EMAIL_SUBJECT_PREFIX
is a standard Django setting.
https://docs.djangoproject.com/en/4.0/ref/settings#email-subject-prefix
It is not used anywhere in Hypha. It was added early on and just stuck around.
I think we could remove it.
Instead we can add a ORG_EMAIL_SUBJECT_PREFIX
that is used for all e-mails Hypha sends.
It could get inserted here:
def send_mail(subject, message, from_address, recipients, logs=None):
# Convenience method to wrap the tasks and handle the callback
send_mail_task.apply_async(
kwargs={
'subject': subject,
'body': message,
'from_email': from_address,
'to': recipients,
},
link=update_message_status.s([log.pk for log in logs]),
)
A default value of '[Hypha] '
or maybe even better f'[{settings.ORG_SHORT_NAME}] '
.
allan
March 10, 2022, 1:09pm
3
brilliant! thanks very much @frjo