Update mail sent

This commit is contained in:
Gregory Trullemans 2023-11-14 12:15:09 +01:00
parent ff78905ec5
commit d991952af8
2 changed files with 13 additions and 6 deletions

View File

@ -21,7 +21,7 @@
<div class="card-footer pl-0 pb-0">
<a href="{% url 'injuries_list' %}">
<button type="submit" value="add" class="btn btn-icon btn-warning ">
<button type="submit" value="add" class="btn btn-icon btn-warning">
<i class="tim-icons icon-double-left"></i>
</button>
</a>

View File

@ -973,7 +973,7 @@ def wellbeing_create_or_update(
receiver,
fail_silently=False,
html_message=f"""<p>Bonjour,</p>
<p>{gymnast} a ajouté état son esprit enregistré ({date}) :
<p>{gymnast} a ajouté son état de bien être pour le ({date.strftime('%d %B %Y')}) :</p>
<ul>
<li>Mindstate: {mindstate}</li>
<li>Sleep: {sleep}</li>
@ -981,7 +981,7 @@ def wellbeing_create_or_update(
<li>Fatigue: {fatigue}</li>
<li>Muscle_soreness: {muscle_soreness}</li>
</ul>
</p><br />
<br />
<p>Excellente journée</p><p>Jarvis</p>""",
)
@ -1063,6 +1063,7 @@ def heightweight_create_or_update(request, heightweight_id=None, gymnast_id=None
# notification
receiver = []
date = form.cleaned_data["date"]
height = form.cleaned_data["height"] / 100
weight = form.cleaned_data["weight"]
bmi = weight / (height * height)
@ -1076,12 +1077,18 @@ def heightweight_create_or_update(request, heightweight_id=None, gymnast_id=None
send_mail(
f"{gymnast} : Nouveau poids/taille enregistré",
f"Un nouveau poids/taille enregistré pour {gymnast} : {height}cm / {weight}kg ({bmi}).",
f"Un nouveau poids/taille enregistré pour {gymnast} ({date}) : {height}cm / {weight}kg (BMI: {bmi}).",
settings.EMAIL_HOST_USER,
receiver,
fail_silently=False,
html_message=f"""<p>Bonjour,</p>
<p>Un nouveau poids/taille enregistré pour {gymnast} : {height}cm / {weight}kg ({bmi}).</p><br />
<p>Un nouveau poids/taille enregistré pour {gymnast} pour le {date.strftime('%d %B %Y')} :</p>
<ul>
<li>{height}cm</li>
<li>{weight}kg</li>
<li>BMI : {bmi}</li>
</ul>
<br />
<p>Excellente journée</p>
<p>Jarvis</p>""",
)
@ -1299,7 +1306,7 @@ def plan_create_or_update(request, plan_id=None, gymnast_id=None, skill_id=None)
receiver,
fail_silently=False,
html_message=f"""<p>Bonjour,</p>
<p>Nouvel objectif fixé pour {gymnast} : {educative} ({learning_step}) pour le {date} au plus tard.</p>
<p>Nouvel objectif fixé pour {gymnast} : {educative} ({learning_step}) pour le {date.strftime('%d %B %Y')} au plus tard.</p>
<br />
<p>Excellente journée</p>
<p>Jarvis</p>""",