diff --git a/scipost/utils.py b/scipost/utils.py index 9e1445e51354b5f43cef3df7f3b00308cf44b6f6..f7d40a0716da0064cfa092e753fe1ecbfaedfec6 100644 --- a/scipost/utils.py +++ b/scipost/utils.py @@ -12,7 +12,7 @@ from .models import * EMAIL_FOOTER = ( '{% load staticfiles %}' - '<ul style="background-color: #f0f0f0; color: #002B49; list-style-type: none;">' + '<ul style="background-color: #f0f0f0; color: #002B49; list-style-type: none; padding: 0px 5px;">' '<li style="display: inline; margin: 0px; padding: 0px;"><a href="https://scipost.org">' '<img src="{% static \'scipost/images/logo_scipost_with_bgd_small.jpg\' %}"></a></li>' '<li style="display: inline; margin: 5px; padding: 5px;">' @@ -29,12 +29,12 @@ EMAIL_FOOTER = ( ) EMAIL_UNSUBSCRIBE_LINK_PLAIN = ( - '\n\nIf you do not with to receive our emails, you can unsubscribe by ' + '\n\nUnsubscribe by ' 'updating your personal data at https://scipost.org/update_personal_data.' ) EMAIL_UNSUBSCRIBE_LINK = ( - '\n\n<p>If you do not with to receive our emails, you can unsubscribe by ' + '\n\n<p style="font-size: 8px;">Unsubscribe by ' '<a href="https://scipost.org/update_personal_data">updating your personal data</a>.</p>' ) diff --git a/scipost/views.py b/scipost/views.py index 9a2176f4e70f4fc6b6225f0a03d4ed2f61918109..6b491d822e1b725c219e6896ba551cd56468e3e5 100644 --- a/scipost/views.py +++ b/scipost/views.py @@ -941,12 +941,14 @@ def email_group_members(request): + form.cleaned_data['email_text'] + EMAIL_UNSUBSCRIBE_LINK_PLAIN) html_template = Template( - 'Dear ' + title_dict[member.contributor.title] + ' ' + - member.last_name + ', \n\n' - + form.cleaned_data['email_text'] - + '\n\n\n' + EMAIL_FOOTER + EMAIL_UNSUBSCRIBE_LINK + 'Dear {{ title }} ' + + member.last_name + ', \n\n{{ email_text|linebreaks }}' + + '\n\n' + EMAIL_FOOTER + EMAIL_UNSUBSCRIBE_LINK ) - context = Context({}) + context = Context( + {'title': title_dict[member.contributor.title], + 'email_text': form.cleaned_data['email_text'], + }) html_version = html_template.render(context) # mail.EmailMessage(form.cleaned_data['email_subject'], # email_text, 'SciPost Admin <admin@scipost.org>',