Verified Commit 461a8117 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Improve emails, fix dry-run and change website from mail

parent ea5b1e35
...@@ -15,18 +15,19 @@ def send_membership_announcement(dry_run=False): ...@@ -15,18 +15,19 @@ def send_membership_announcement(dry_run=False):
for member in members: for member in members:
print("Send email to {} ({})".format(member.get_full_name(), print("Send email to {} ({})".format(member.get_full_name(),
with translation.override(member.language): if not dry_run:
email_body = loader.render_to_string( with translation.override(member.language):
'members/email/membership_announcement.txt', email_body = loader.render_to_string(
{'name': member.get_full_name()}) 'members/email/membership_announcement.txt',
mail.EmailMessage( {'name': member.get_full_name()})
_('Membership announcement'), mail.EmailMessage(
email_body, _('Membership announcement'),
settings.WEBSITE_FROM_ADDRESS, email_body,
connection=connection bcc=[settings.BOARD_NOTIFICATION_ADDRESS],
).send() connection=connection
if not dry_run: if not dry_run:
mail.mail_managers( mail.mail_managers(
...@@ -7,8 +7,8 @@ msgid "" ...@@ -7,8 +7,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-09 22:32+0200\n" "POT-Creation-Date: 2017-06-14 21:21+0200\n"
"PO-Revision-Date: 2017-06-09 22:33+0200\n" "PO-Revision-Date: 2017-06-14 21:22+0200\n"
"Last-Translator: Sébastiaan Versteeg <>\n" "Last-Translator: Sébastiaan Versteeg <>\n"
"Language-Team: \n" "Language-Team: \n"
"Language: nl\n" "Language: nl\n"
...@@ -16,7 +16,7 @@ msgstr "" ...@@ -16,7 +16,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 2.0.1\n" "X-Generator: Poedit 2.0.2\n"
#: #:
msgid "membership type" msgid "membership type"
...@@ -74,11 +74,11 @@ msgstr "Studentnummer" ...@@ -74,11 +74,11 @@ msgstr "Studentnummer"
msgid "Download student number label for selected users" msgid "Download student number label for selected users"
msgstr "Download studentnummers voor geselecteerde gebruikers" msgstr "Download studentnummers voor geselecteerde gebruikers"
#: #:
msgid "Membership announcement" msgid "Membership announcement"
msgstr "Mededeling over lidmaatschap" msgstr "Mededeling over lidmaatschap"
#: #:
msgid "Membership announcement sent" msgid "Membership announcement sent"
msgstr "Mededeling over lidmaatschap verzonden" msgstr "Mededeling over lidmaatschap verzonden"
...@@ -452,7 +452,11 @@ msgid "" ...@@ -452,7 +452,11 @@ msgid ""
"\n" "\n"
"With kind regards,\n" "With kind regards,\n"
"\n" "\n"
"The board of Study Association Thalia" "The board of Study Association Thalia\n"
"This email was automatically generated."
msgstr "" msgstr ""
"Dear %(name)s,\n" "Dear %(name)s,\n"
"\n" "\n"
...@@ -468,7 +472,11 @@ msgstr "" ...@@ -468,7 +472,11 @@ msgstr ""
"\n" "\n"
"Met vriendelijke groeten,\n" "Met vriendelijke groeten,\n"
"\n" "\n"
"Het bestuur" "Het bestuur der Studievereniging Thalia\n"
"Deze e-mail is automatisch gegenereerd."
#: templates/members/email/welcome.txt:1 #: templates/members/email/welcome.txt:1
#, python-format #, python-format
...@@ -11,4 +11,8 @@ If you have any questions, then don't hesitate and send us an email. ...@@ -11,4 +11,8 @@ If you have any questions, then don't hesitate and send us an email.
With kind regards, With kind regards,
The board of Study Association Thalia{% endblocktrans %} The board of Study Association Thalia
This email was automatically generated.{% endblocktrans %}
Geacht bestuur, Dear board,
Vanwege de tijd van het jaar heeft de website automatisch iedereen met een studielidmaatschap een email gestuurd. It's that time of the year again! The website sent an automatic email to
all members that have a study membership.
In die email staat dat het lidmaatschap geldig is zolang ze een studie informatica en/of informatiekunde volgen. That email tells them that their membership is valid as long as they're enrolled
We hebben deze mensen gevraagd om, indien ze afgestudeerd zijn of om een andere reden gestopt met hun studie, in either a computer science or an information science programme.
een mailtje te sturen naar Hierbij willen we graag laten weten dat jullie deze emails kunnen verwachten. We asked them to notify you when they graduate or stop with their studies for any
other reason so that you'll be able to update the administration.
De email is gestuurd naar: This means that you can expect an influx of emails from members.
The email was sent to:
{% for member in members %} {% for member in members %}
* {{ member.full_name }} * {{ member.full_name }}
{% endfor %} {% endfor %}
Kusjes, Kisses,
De website The website
...@@ -234,7 +234,7 @@ SERVER_EMAIL = DEFAULT_FROM_EMAIL ...@@ -234,7 +234,7 @@ SERVER_EMAIL = DEFAULT_FROM_EMAIL
# Website FROM address # Website FROM address
# Board notification address # Board notification address
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment