Unify email signature and fix issue with injury email

This commit is contained in:
Gregory Trullemans 2023-11-26 17:29:28 +01:00
parent 562aab8b70
commit fbe02f39c5
1 changed files with 40 additions and 63 deletions

View File

@ -99,6 +99,25 @@ twitterwidget .NaturalImage-image {
</body></html>"""
MAIL_FOOTER = """<br />
<p>Excellente journée</p>
<p>Jarvis</p>
<p><b>Trampoline Trainer Help</b></p>
<table border="0">
<tbody>
<tr>
<td>
<img id="CB70323B-AC4A-4992-9DD8-3F25DC32658C" height="80px" src="https://www.flyingacrobaticstrampoline.be/img/logo_120px.png" style="max-width: 100vw;">
</td>
<td>
<b><span class="" style="color: rgb(253, 221, 12);">F</span><span class="" style="color: rgb(251, 214, 13);">l</span><span class="" style="color: rgb(249, 207, 14);">y</span><span class="" style="color: rgb(247, 200, 15);">i</span><span class="" style="color: rgb(245, 194, 16);">n</span><span class="" style="color: rgb(243, 187, 17);">g</span>&nbsp;<span class="" style="color: rgb(241, 180, 18);"></span><span class="" style="color: rgb(239, 173, 19);">A</span><span class="" style="color: rgb(237, 166, 20);">c</span><span class="" style="color: rgb(234, 159, 21);">r</span><span class="" style="color: rgb(232, 153, 22);">o</span><span class="" style="color: rgb(230, 146, 23);">b</span><span class="" style="color: rgb(228, 139, 24);">a</span><span class="" style="color: rgb(226, 132, 25);">t</span><span class="" style="color: rgb(224, 125, 26);">i</span><span class="" style="color: rgb(222, 118, 27);">c</span><span class="" style="color: rgb(220, 112, 28);">s</span>&nbsp;<span class="" style="color: rgb(218, 105, 29);"></span><span class="" style="color: rgb(216, 98, 30);">T</span><span class="" style="color: rgb(214, 91, 31);">r</span><span class="" style="color: rgb(212, 84, 32);">a</span><span class="" style="color: rgb(210, 77, 33);">m</span><span class="" style="color: rgb(208, 70, 34);">p</span><span class="" style="color: rgb(206, 64, 35);">o</span><span class="" style="color: rgb(204, 57, 36);">l</span><span class="" style="color: rgb(201, 50, 37);">i</span><span class="" style="color: rgb(199, 43, 38);">n</span><span class="" style="color: rgb(197, 36, 39);">e</span>&nbsp;<span class="" style="color: rgb(195, 29, 40);"></span><span class="" style="color: rgb(193, 23, 41);">C</span><span class="" style="color: rgb(191, 16, 42);">l</span><span class="" style="color: rgb(189, 9, 43);">u</span><span class="" style="color: rgb(187, 2, 44);">b</span></b><br>
<span style="font-size: 13px; letter-spacing: 0.01em; line-height: 1.2;">Rue René Francq, 7</span><br>
<span style="font-size: 13px; letter-spacing: 0.01em; line-height: 1.2;">1428 Lillois-Witterzée</span>
</td>
</tr>
</tbody>
</table>"""
@login_required
@require_http_methods(["GET"])
@ -558,8 +577,7 @@ def note_create_or_update(request, note_id=None, gymnast_id=None):
fail_silently=False,
html_message=f"""<p>Bonjour,</p>
<p>Une nouvelle note vous a été envoyée. Vous pouvez la consulter en cliquant <a href='{url}'>ici</a>.</p>
<p>Excellente journée</p>
<p>Jarvis</p>""",
{MAIL_FOOTER}""",
)
return HttpResponseRedirect(
reverse("gymnast_details_tab", args=(new_note.gymnast.id, "event"))
@ -633,8 +651,8 @@ def chrono_create_or_update(request, chrono_id=None, gymnast_id=None):
receiver,
fail_silently=False,
html_message=f"""<p>Bonjour,</p>
<p>Nouveau chrono pour {gymnast} : {SCORE_TYPE_CHOICE[score_type][1]} {CHRONO_TYPE_CHOICE[chrono_type][1]} - {score}.</p><br />
<p>Excellente journée</p><p>Jarvis</p>""",
<p>Nouveau chrono pour {gymnast} : {SCORE_TYPE_CHOICE[score_type][1]} {CHRONO_TYPE_CHOICE[chrono_type][1]} - {score}.</p>
{MAIL_FOOTER}""",
)
return HttpResponseRedirect(
@ -721,8 +739,8 @@ def learnedskill_create_or_update(request, gymnast_id=None):
receiver,
fail_silently=False,
html_message=f"""<p>Bonjour,</p>
<p>{gymnast} a appris {skill} ({learning_step}).</p><br />
<p>Excellente journée</p><p>Jarvis</p>""",
<p>{gymnast} a appris {skill} ({learning_step}).</p>
{MAIL_FOOTER}""",
)
return HttpResponseRedirect(
@ -785,8 +803,8 @@ def score_create_or_update(request, score_id=None, gymnast_id=None):
receiver,
fail_silently=False,
html_message=f"""<p>Bonjour,</p>
<p>Un nouveau score a été enregistré pour {gymnast} ({event}) : {routine_type} - {total}.</p><br />
<p>Excellente journée</p><p>Jarvis</p>""",
<p>Un nouveau score a été enregistré pour {gymnast} ({event}) : {routine_type} - {total}.</p>
{MAIL_FOOTER}""",
)
if form.cleaned_data["add_to_chrono"]:
@ -923,14 +941,12 @@ def injury_create_or_update(request, injury_id=None, gymnast_id=None):
html_message=f"""<p>Bonjour,</p>
<p>Un nouvelle blessure enregistrée pour {gymnast} pour le {date.strftime('%d %B %Y')}:</p>
<ul>
<li>{INJURY_LOCATION_CHOICE[mechanism][1]},</li>
<li>{INJURY_BODY_SIDE_CHOICE[injury_type][1]},</li>
<li>{INJURY_MECHANISM_CHOICE[location][1]},</li>
<li>{INJURY_TYPE_CHOICE[body_side][1]},</li>
<li>{INJURY_MECHANISM_CHOICE[mechanism][1]},</li>
<li>{INJURY_TYPE_CHOICE[injury_type][1]},</li>
<li>{INJURY_LOCATION_CHOICE[location][1]},</li>
<li>{INJURY_BODY_SIDE_CHOICE[body_side][1]},</li>
</ul>
<br />
<p>Excellente journée</p>
<p>Jarvis</p>""",
{MAIL_FOOTER}""",
)
return HttpResponseRedirect(reverse("injury_details", args=(injury.pk,)))
@ -1038,24 +1054,8 @@ def wellbeing_create_or_update(
<li>Fatigue: {fatigue}</li>
<li>Muscle soreness: {muscle_soreness}</li>
</ul>
<br />
<p>Excellente journée</p>
<p>Jarvis</p>
<p><b>Trampoline Trainer Help</b></p>
<table border="0">
<tbody>
<tr>
<td>
<img id="CB70323B-AC4A-4992-9DD8-3F25DC32658C" height="80px" src="https://www.flyingacrobaticstrampoline.be/img/logo_120px.png" style="max-width: 100vw;">
</td>
<td>
<b><span class="" style="color: rgb(253, 221, 12);">F</span><span class="" style="color: rgb(251, 214, 13);">l</span><span class="" style="color: rgb(249, 207, 14);">y</span><span class="" style="color: rgb(247, 200, 15);">i</span><span class="" style="color: rgb(245, 194, 16);">n</span><span class="" style="color: rgb(243, 187, 17);">g</span>&nbsp;<span class="" style="color: rgb(241, 180, 18);"></span><span class="" style="color: rgb(239, 173, 19);">A</span><span class="" style="color: rgb(237, 166, 20);">c</span><span class="" style="color: rgb(234, 159, 21);">r</span><span class="" style="color: rgb(232, 153, 22);">o</span><span class="" style="color: rgb(230, 146, 23);">b</span><span class="" style="color: rgb(228, 139, 24);">a</span><span class="" style="color: rgb(226, 132, 25);">t</span><span class="" style="color: rgb(224, 125, 26);">i</span><span class="" style="color: rgb(222, 118, 27);">c</span><span class="" style="color: rgb(220, 112, 28);">s</span>&nbsp;<span class="" style="color: rgb(218, 105, 29);"></span><span class="" style="color: rgb(216, 98, 30);">T</span><span class="" style="color: rgb(214, 91, 31);">r</span><span class="" style="color: rgb(212, 84, 32);">a</span><span class="" style="color: rgb(210, 77, 33);">m</span><span class="" style="color: rgb(208, 70, 34);">p</span><span class="" style="color: rgb(206, 64, 35);">o</span><span class="" style="color: rgb(204, 57, 36);">l</span><span class="" style="color: rgb(201, 50, 37);">i</span><span class="" style="color: rgb(199, 43, 38);">n</span><span class="" style="color: rgb(197, 36, 39);">e</span>&nbsp;<span class="" style="color: rgb(195, 29, 40);"></span><span class="" style="color: rgb(193, 23, 41);">C</span><span class="" style="color: rgb(191, 16, 42);">l</span><span class="" style="color: rgb(189, 9, 43);">u</span><span class="" style="color: rgb(187, 2, 44);">b</span></b><br>
<span style="font-size: 13px; letter-spacing: 0.01em; line-height: 1.2;">Rue René Francq, 7</span><br>
<span style="font-size: 13px; letter-spacing: 0.01em; line-height: 1.2;">1428 Lillois-Witterzée</span>
</td>
</tr>
</tbody>
</table>""",
{MAIL_FOOTER}
""",
)
return HttpResponseRedirect(
@ -1161,9 +1161,7 @@ def heightweight_create_or_update(request, heightweight_id=None, gymnast_id=None
<li>Weight: {weight} kg</li>
<li>BMI: {bmi}</li>
</ul>
<br />
<p>Excellente journée</p>
<p>Jarvis</p>""",
{MAIL_FOOTER}""",
)
return HttpResponseRedirect(
@ -1302,9 +1300,8 @@ def routinedone_create_or_update(request, routinedone_id=None, gymnast_id=None):
receiver,
fail_silently=False,
html_message=f"""<p>Bonjour,</p>
<p>Nouvelle série comptabilisée pour {gymnast}.</p><br />
<p>Excellente journée</p>
<p>Jarvis</p>""",
<p>Nouvelle série comptabilisée pour {gymnast}.</p>
{MAIL_FOOTER}""",
)
return HttpResponseRedirect(
@ -1380,9 +1377,7 @@ def plan_create_or_update(request, plan_id=None, gymnast_id=None, skill_id=None)
fail_silently=False,
html_message=f"""<p>Bonjour,</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>""",
{MAIL_FOOTER}""",
)
return HttpResponseRedirect(
@ -1511,24 +1506,7 @@ def intensity_create_or_update(request, intensity_id=None, gymnast_id=None):
<li>Diff/passe: {diff_by_passe:.2f}</li>
<li>Diff/skill: {diff_by_skill:.2f}</li>
</ul>
<p>Excellente journée</p>
<br />
<p>Jarvis</p>
<p><b>Trampoline Trainer Help</b></p>
<table border="0">
<tbody>
<tr>
<td>
<img id="CB70323B-AC4A-4992-9DD8-3F25DC32658C" height="80px" src="https://www.flyingacrobaticstrampoline.be/img/logo_120px.png" style="max-width: 100vw;">
</td>
<td>
<b><span class="" style="color: rgb(253, 221, 12);">F</span><span class="" style="color: rgb(251, 214, 13);">l</span><span class="" style="color: rgb(249, 207, 14);">y</span><span class="" style="color: rgb(247, 200, 15);">i</span><span class="" style="color: rgb(245, 194, 16);">n</span><span class="" style="color: rgb(243, 187, 17);">g</span>&nbsp;<span class="" style="color: rgb(241, 180, 18);"></span><span class="" style="color: rgb(239, 173, 19);">A</span><span class="" style="color: rgb(237, 166, 20);">c</span><span class="" style="color: rgb(234, 159, 21);">r</span><span class="" style="color: rgb(232, 153, 22);">o</span><span class="" style="color: rgb(230, 146, 23);">b</span><span class="" style="color: rgb(228, 139, 24);">a</span><span class="" style="color: rgb(226, 132, 25);">t</span><span class="" style="color: rgb(224, 125, 26);">i</span><span class="" style="color: rgb(222, 118, 27);">c</span><span class="" style="color: rgb(220, 112, 28);">s</span>&nbsp;<span class="" style="color: rgb(218, 105, 29);"></span><span class="" style="color: rgb(216, 98, 30);">T</span><span class="" style="color: rgb(214, 91, 31);">r</span><span class="" style="color: rgb(212, 84, 32);">a</span><span class="" style="color: rgb(210, 77, 33);">m</span><span class="" style="color: rgb(208, 70, 34);">p</span><span class="" style="color: rgb(206, 64, 35);">o</span><span class="" style="color: rgb(204, 57, 36);">l</span><span class="" style="color: rgb(201, 50, 37);">i</span><span class="" style="color: rgb(199, 43, 38);">n</span><span class="" style="color: rgb(197, 36, 39);">e</span>&nbsp;<span class="" style="color: rgb(195, 29, 40);"></span><span class="" style="color: rgb(193, 23, 41);">C</span><span class="" style="color: rgb(191, 16, 42);">l</span><span class="" style="color: rgb(189, 9, 43);">u</span><span class="" style="color: rgb(187, 2, 44);">b</span></b><br>
<span style="font-size: 13px; letter-spacing: 0.01em; line-height: 1.2;">Rue René Francq, 7</span><br>
<span style="font-size: 13px; letter-spacing: 0.01em; line-height: 1.2;">1428 Lillois-Witterzée</span>
</td>
</tr>
</tbody>
</table>""",
{MAIL_FOOTER}""",
)
return HttpResponseRedirect(
@ -1598,9 +1576,8 @@ def season_information_create_or_update(
receiver,
fail_silently=False,
html_message=f"""<p>Bonjour,</p>
<p>Une nouvelle information de saison enregistrée pour {gymnast}.</p><br />
<p>Excellente journée</p>
<p>Jarvis</p>""",
<p>Une nouvelle information de saison enregistrée pour {gymnast}.</p>
{MAIL_FOOTER}""",
)
return HttpResponseRedirect(