1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-21 01:18:22 +02:00

Send mail with plain text to new organizers

This commit is contained in:
Yohann D'ANELLO
2020-05-05 17:29:35 +02:00
parent faba118955
commit b835f26611
2 changed files with 15 additions and 2 deletions

View File

@ -188,8 +188,9 @@ class AddOrganizerView(AdminMixin, CreateView):
def form_valid(self, form):
user = form.instance
msg = render_to_string("mail_templates/add_organizer.html", context=dict(user=user))
send_mail('Organisateur du TFJM² 2020', msg, 'contact@tfjm.org', [user.email])
msg = render_to_string("mail_templates/add_organizer.txt", context=dict(user=user))
msg_html = render_to_string("mail_templates/add_organizer.html", context=dict(user=user))
send_mail('Organisateur du TFJM² 2020', msg, 'contact@tfjm.org', [user.email], html_message=msg_html)
return super().form_valid(form)
def get_success_url(self):