From 580c24e91695bece244a36c1f3ef162386ae01f2 Mon Sep 17 00:00:00 2001 From: Raz Date: Wed, 29 Jan 2025 15:23:42 +0100 Subject: [PATCH] fix issue with registration email service --- tournaments/services/email_service.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tournaments/services/email_service.py b/tournaments/services/email_service.py index f019848..e2b0c7c 100644 --- a/tournaments/services/email_service.py +++ b/tournaments/services/email_service.py @@ -127,7 +127,7 @@ class TournamentEmailService: def send_out_of_waiting_list_confirmation(captain, tournament, other_player): tournament_details_str = tournament.build_tournament_details_str() email_subject = TournamentEmailService.email_subject(tournament, "Participation au tournoi") - email_body = TournamentEmailService._buil_out_of_waiting_list_email_body( + email_body = TournamentEmailService._build_out_of_waiting_list_email_body( tournament, captain, tournament_details_str, @@ -144,7 +144,7 @@ class TournamentEmailService: email.send() if other_player.email is not None: - email_body = TournamentEmailService._buil_out_of_waiting_list_email_body( + email_body = TournamentEmailService._build_out_of_waiting_list_email_body( tournament, other_player, tournament_details_str, @@ -172,6 +172,14 @@ class TournamentEmailService: f"\n\nVous étiez inscrit avec {other_player.name()}, n'oubliez pas de prévenir votre partenaire." ) + absolute_url = f"https://padelclub.app/tournament/{tournament.id}/info" + link_text = "informations sur le tournoi" + absolute_url = f'{link_text}' + + body_parts.append( + f"\n\nVoir les {absolute_url}", + ) + body_parts.extend([ "\n\nPour toute question, veuillez contacter votre juge-arbitre. " "Si vous n'êtes pas à l'origine de cette désinscription, merci de le contacter rapidement.", @@ -182,7 +190,7 @@ class TournamentEmailService: return "".join(body_parts) @staticmethod - def _buil_out_of_waiting_list_email_body(tournament, captain, tournament_details_str, other_player): + def _build_out_of_waiting_list_email_body(tournament, captain, tournament_details_str, other_player): body_parts = [ "Bonjour,\n\n", f"Suite au désistement d'une paire, vous êtes maintenant inscrit au tournoi {tournament_details_str}, prévu le {tournament.formatted_start_date()} au club {tournament.event.club.name}"