Update email sendinf when linking gymnast/event
This commit is contained in:
parent
cb960691fe
commit
8640d35ab5
|
@ -141,7 +141,7 @@
|
|||
$(this).remove();
|
||||
});
|
||||
}).fail(function(){
|
||||
alert('Not done !');
|
||||
alert('Gymnast not unlinked !');
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
|
|
@ -83,6 +83,7 @@ def link_gymnast_to_event(request):
|
|||
gymnast = get_object_or_404(Gymnast, pk=gymnast_id)
|
||||
event = get_object_or_404(Event, pk=event_id)
|
||||
EventParticipation.objects.create(gymnast=gymnast, event=event)
|
||||
url = request.build_absolute_uri(reverse("event_details", args=(event_id)))
|
||||
|
||||
send_mail(
|
||||
"Association à un évènement.",
|
||||
|
@ -90,14 +91,10 @@ def link_gymnast_to_event(request):
|
|||
settings.EMAIL_HOST_USER,
|
||||
[gymnast.user.email, gymnast.email_trainer],
|
||||
fail_silently=False,
|
||||
html_message="""<p>Bonjour,</p>
|
||||
<p>Vous avez été associé(e) à un évènement. Vous pouvez consulter les détails de l'évènement <a href='"
|
||||
+ request.build_absolute_uri(
|
||||
reverse(
|
||||
"event_details", args=(event_id)
|
||||
)
|
||||
)
|
||||
+ "'>ici</a>.</p><br /><p>Excellente journée</p><p>Jarvis</p>""",
|
||||
html_message=f"""<p>Bonjour,</p>
|
||||
<p>Vous avez été associé(e) à un évènement. Vous pouvez consulter les détails de l'évènement <a href='{url}'>ici</a>.</p>
|
||||
<br />
|
||||
<p>Excellente journée</p><p>Jarvis</p>""",
|
||||
)
|
||||
except Exception:
|
||||
return HttpResponse(409)
|
||||
|
|
Loading…
Reference in New Issue