Commit 9cc2ef53 authored by Luuk Scholten's avatar Luuk Scholten
Browse files

Merge branch 'feature/103-5-information-mail' into 'master'

Administratietrucjes: information check email

See merge request !507
parents 9367c917 4f502b40
...@@ -37,3 +37,35 @@ def send_membership_announcement(dry_run=False): ...@@ -37,3 +37,35 @@ def send_membership_announcement(dry_run=False):
{'members': members}), {'members': members}),
connection=connection, connection=connection,
) )
def send_information_request(dry_run=False):
members = models.Member.active_members.all()
with mail.get_connection() as connection:
for member in members:
print("Send email to {} ({})".format(member.get_full_name(),
member.user.email))
if not dry_run:
with translation.override(member.language):
email_body = loader.render_to_string(
'members/email/information_check.txt',
{'name': member.get_full_name(),
'member': member})
mail.EmailMessage(
_('Membership information check'),
email_body,
settings.WEBSITE_FROM_ADDRESS,
[member.user.email],
bcc=[settings.BOARD_NOTIFICATION_ADDRESS],
connection=connection
).send()
if not dry_run:
mail.mail_managers(
_('Membership information check sent'),
loader.render_to_string(
'members/email/information_check_notification.txt',
{'members': members}),
connection=connection,
)
...@@ -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-14 21:21+0200\n" "POT-Creation-Date: 2017-06-15 12:20+0200\n"
"PO-Revision-Date: 2017-06-14 21:22+0200\n" "PO-Revision-Date: 2017-06-15 12:20+0200\n"
"Last-Translator: Sébastiaan Versteeg <se_bastiaan@outlook.com>\n" "Last-Translator: Sébastiaan Versteeg <se_bastiaan@outlook.com>\n"
"Language-Team: \n" "Language-Team: \n"
"Language: nl\n" "Language: nl\n"
...@@ -38,39 +38,39 @@ msgstr "< 18" ...@@ -38,39 +38,39 @@ msgstr "< 18"
msgid "Unknown" msgid "Unknown"
msgstr "Onbekend" msgstr "Onbekend"
#: admin.py:120 admin.py:139 #: admin.py:121 admin.py:140
msgid "First name" msgid "First name"
msgstr "Voornaam" msgstr "Voornaam"
#: admin.py:120 admin.py:139 #: admin.py:121 admin.py:140
msgid "Last name" msgid "Last name"
msgstr "Achternaam" msgstr "Achternaam"
#: admin.py:120 #: admin.py:121
msgid "Address" msgid "Address"
msgstr "Adres" msgstr "Adres"
#: admin.py:121 #: admin.py:122
msgid "Address line 2" msgid "Address line 2"
msgstr "Tweede adresregel" msgstr "Tweede adresregel"
#: admin.py:121 models.py:152 #: admin.py:122 models.py:152
msgid "Postal code" msgid "Postal code"
msgstr "Postcode" msgstr "Postcode"
#: admin.py:121 models.py:158 #: admin.py:122 models.py:158
msgid "City" msgid "City"
msgstr "Woonplaats" msgstr "Woonplaats"
#: admin.py:131 #: admin.py:132
msgid "Download address label for selected users" msgid "Download address label for selected users"
msgstr "Download adreslabels voor geselecteerde gebruikers" msgstr "Download adreslabels voor geselecteerde gebruikers"
#: admin.py:139 models.py:76 #: admin.py:140 models.py:76
msgid "Student number" msgid "Student number"
msgstr "Studentnummer" msgstr "Studentnummer"
#: admin.py:146 #: admin.py:147
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"
...@@ -82,6 +82,14 @@ msgstr "Mededeling over lidmaatschap" ...@@ -82,6 +82,14 @@ msgstr "Mededeling over lidmaatschap"
msgid "Membership announcement sent" msgid "Membership announcement sent"
msgstr "Mededeling over lidmaatschap verzonden" msgstr "Mededeling over lidmaatschap verzonden"
#: emails.py:55
msgid "Membership information check"
msgstr "Controle gegevens lidmaatschap"
#: emails.py:65
msgid "Membership information check sent"
msgstr "Controle gegevens lidmaatschap verzonden"
#: forms.py:42 #: forms.py:42
msgid "Send welcome email" msgid "Send welcome email"
msgstr "Stuur welkomste-mails" msgstr "Stuur welkomste-mails"
...@@ -352,6 +360,10 @@ msgstr "Lid tot" ...@@ -352,6 +360,10 @@ msgstr "Lid tot"
msgid "The date the member stops holding this membership." msgid "The date the member stops holding this membership."
msgstr "De datum waarop het lid dit lidmaatschap beëindigd." msgstr "De datum waarop het lid dit lidmaatschap beëindigd."
#: templates/admin/members/change_list.html:6
msgid "Export IBANs for Direct Debit"
msgstr ""
#: templates/members/account.html:6 templates/members/account.html:7 #: templates/members/account.html:6 templates/members/account.html:7
#: templates/members/edit_profile.html:5 templates/members/edit_profile.html:6 #: templates/members/edit_profile.html:5 templates/members/edit_profile.html:6
#: templates/members/index.html:7 templates/members/index.html:8 #: templates/members/index.html:7 templates/members/index.html:8
...@@ -434,6 +446,72 @@ msgstr "" ...@@ -434,6 +446,72 @@ msgstr ""
msgid "save" msgid "save"
msgstr "opslaan" msgstr "opslaan"
#: templates/members/email/information_check.txt:1
#, python-format
msgid ""
"Dear %(name)s,\n"
"\n"
"We currently have the following information about you in our database.\n"
"Via this email we'd like to ask you to check the accuracy of this data.\n"
"\n"
"Username: %(member.user.username)s\n"
"Name: %(member.get_full_name)s\n"
"Address: %(member.address_street)s\n"
" %(member.address_street2)s\n"
" %(member.address_postal_code)s\n"
" %(member.address_city)s\n"
"Phone: %(member.phone_number)s\n"
"Date of birth: %(member.birthday)s\n"
"Email address: %(member.user.email)s\n"
"Student number: %(member.student_number)s\n"
"Cohort: %(member.starting_year)s\n"
"Programme: %(member.programme)s\n"
"\n"
"You can change this data by logging into the website and using the 'edit "
"profile' page.\n"
"Unable to edit the incorrect information? Then send an email: info@thalia."
"nu.\n"
"\n"
"With kind regards,\n"
"\n"
"The board of Study Association Thalia\n"
"\n"
"————\n"
"\n"
"This email was automatically generated."
msgstr ""
"Beste %(name)s,\n"
"\n"
"Hieronder vind je de (meeste) gegevens die we op dit moment van je "
"geregistreerd\n"
"hebben. Wil je deze controleren op juistheid?\n"
"\n"
"Gebruikersnaam: %(member.user.username)s\n"
"Naam: %(member.get_full_name)s\n"
"Adres: %(member.address_street)s\n"
" %(member.address_street2)s\n"
" %(member.address_postal_code)s\n"
" %(member.address_city)s\n"
"Telefoonnummer: %(member.phone_number)s\n"
"Geboortedatum: %(member.birthday)s\n"
"Emailadres: %(member.user.email)s\n"
"Studentnummer: %(member.student_number)s\n"
"Cohort: %(member.starting_year)s\n"
"Programma: %(member.programme)s\n"
"\n"
"Je kunt als je ingelogd bent via ‘Mijn gegevens’ de meeste van deze "
"gegevens\n"
"aanpassen. Klopt iets niet wat je niet zelf kunt bewerken? Stuur dan een "
"mailtje\n"
"naar info@thalia.nu.\n"
"\n"
"Met vriendelijke groet,\n"
"Het bestuur der Studievereniging Thalia\n"
"\n"
"————\n"
"\n"
"Deze e-mail is automatisch gegenereerd."
#: templates/members/email/membership_announcement.txt:1 #: templates/members/email/membership_announcement.txt:1
#, python-format #, python-format
msgid "" msgid ""
...@@ -575,6 +653,6 @@ msgstr "Statistieken" ...@@ -575,6 +653,6 @@ msgstr "Statistieken"
msgid "Total amount of Thalia members" msgid "Total amount of Thalia members"
msgstr "Totaal aantal Thalialeden" msgstr "Totaal aantal Thalialeden"
#: views.py:105 #: views.py:108
msgid "Former member" msgid "Former member"
msgstr "Oud-lid" msgstr "Oud-lid"
from django.core.management.base import BaseCommand
from members import emails
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument(
'--dry-run',
action='store_true',
dest='dry-run',
default=False,
help='Dry run instead of sending e-mail',
)
def handle(self, *args, **options):
emails.send_information_request(
bool(options['dry-run']))
{% load i18n %}{% blocktrans %}Dear {{ name }},
We currently have the following information about you in our database.
Via this email we'd like to ask you to check the accuracy of this data.
Username: {{ member.user.username }}
Name: {{ member.get_full_name }}
Address: {{ member.address_street }}
{{ member.address_street2 }}
{{ member.address_postal_code }}
{{ member.address_city }}
Phone: {{ member.phone_number }}
Date of birth: {{ member.birthday }}
Email address: {{ member.user.email }}
Student number: {{ member.student_number }}
Cohort: {{ member.starting_year }}
Programme: {{ member.programme }}
You can change this data by logging into the website and using the 'edit profile' page.
Unable to edit the incorrect information? Then send an email: info@thaliagit.nu.
With kind regards,
The board of Study Association Thalia
————
This email was automatically generated.{% endblocktrans %}
Dear board,
It's that time of the year again! The website sent an automatic email to all members.
That email asks them to check their information we currently have in our database.
This means that you can expect an influx of emails from members.
The email was sent to:
{% for member in members %}
* {{ member.full_name }}
{% endfor %}
Kisses,
The website
Supports Markdown
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