fix issue with registration email service

bracket-feature
Raz 9 months ago
parent 7515f15b7f
commit 580c24e916
  1. 14
      tournaments/services/email_service.py

@ -127,7 +127,7 @@ class TournamentEmailService:
def send_out_of_waiting_list_confirmation(captain, tournament, other_player): def send_out_of_waiting_list_confirmation(captain, tournament, other_player):
tournament_details_str = tournament.build_tournament_details_str() tournament_details_str = tournament.build_tournament_details_str()
email_subject = TournamentEmailService.email_subject(tournament, "Participation au tournoi") 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, tournament,
captain, captain,
tournament_details_str, tournament_details_str,
@ -144,7 +144,7 @@ class TournamentEmailService:
email.send() email.send()
if other_player.email is not None: 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, tournament,
other_player, other_player,
tournament_details_str, 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." 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'<a href="{absolute_url}">{link_text}</a>'
body_parts.append(
f"\n\nVoir les {absolute_url}",
)
body_parts.extend([ body_parts.extend([
"\n\nPour toute question, veuillez contacter votre juge-arbitre. " "\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.", "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) return "".join(body_parts)
@staticmethod @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 = [ body_parts = [
"Bonjour,\n\n", "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}" 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}"

Loading…
Cancel
Save