diff --git a/src/core/logic.py b/src/core/logic.py index 3f929f52b8..694a3517fd 100755 --- a/src/core/logic.py +++ b/src/core/logic.py @@ -54,14 +54,14 @@ def send_reset_token(request, reset_token): request.press.password_reset_text, template_is_setting=True, ) - subject = 'Password Reset' else: message = render_template.get_message_content( request, context, 'password_reset', ) - subject = 'subject_password_reset' + + subject = 'subject_password_reset' notify_helpers.send_email_with_body_from_user( request, @@ -90,14 +90,14 @@ def send_confirmation_link(request, new_user): request.press.registration_text, template_is_setting=True, ) - subject = 'Registration Confirmation' else: message = render_template.get_message_content( request, context, 'new_user_registration', ) - subject = 'subject_new_user_registration' + + subject = 'subject_new_user_registration' notify_helpers.send_slack( request, diff --git a/src/utils/notify_plugins/notify_email.py b/src/utils/notify_plugins/notify_email.py index 3e5072569a..7d05910e7c 100755 --- a/src/utils/notify_plugins/notify_email.py +++ b/src/utils/notify_plugins/notify_email.py @@ -109,9 +109,16 @@ def notify_hook(**kwargs): task = kwargs.pop('task', None) custom_reply_to = kwargs.pop('custom_reply_to', None) - if request and request.journal: - subject_setting = setting_handler.get_email_subject_setting('email_subject', subject, request.journal) - subject = "[{0}] {1}".format(request.journal.code, subject_setting if subject_setting else subject) + if request: + subject_setting_value = setting_handler.get_email_subject_setting( + 'email_subject', + subject, + request.journal + ) + if request.journal: + subject = f"[{request.journal.code}] {subject_setting_value}" + else: + subject = subject_setting_value # call the method if not task: