diff --git a/as-talange-core/src/main/java/com/astalange/core/service/SportEasyEmailService.java b/as-talange-core/src/main/java/com/astalange/core/service/SportEasyEmailService.java index 2892855..053d315 100644 --- a/as-talange-core/src/main/java/com/astalange/core/service/SportEasyEmailService.java +++ b/as-talange-core/src/main/java/com/astalange/core/service/SportEasyEmailService.java @@ -67,13 +67,16 @@ public class SportEasyEmailService { ? licence.getCategorie().getSportEasyToken().trim() : ""; + if (token.isEmpty()) { + throw new IllegalStateException("Le lien d'invitation SportEasy n'a pas été renseigné pour la catégorie " + + (licence.getCategorie() != null ? licence.getCategorie().getNom() : "") + "."); + } + String inviteUrl; if (token.startsWith("http://") || token.startsWith("https://")) { inviteUrl = token; - } else if (!token.isEmpty()) { - inviteUrl = sportEasyBaseUrl.endsWith("/") ? sportEasyBaseUrl + token : sportEasyBaseUrl + "/" + token; } else { - inviteUrl = sportEasyBaseUrl; + inviteUrl = sportEasyBaseUrl.endsWith("/") ? sportEasyBaseUrl + token : sportEasyBaseUrl + "/" + token; } String adherentNom = licence.getAdherent().getPrenom() + " " + licence.getAdherent().getNom(); @@ -193,6 +196,7 @@ public class SportEasyEmailService { .header h1 { margin: 0; font-size: 22px; } .content { padding: 24px; line-height: 1.6; } .btn { display: inline-block; background-color: #2563eb; color: #ffffff !important; padding: 12px 24px; border-radius: 6px; text-decoration: none; font-weight: bold; margin-top: 16px; text-align: center; } + .url-box { background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 6px; padding: 12px; margin-top: 16px; font-size: 13px; word-break: break-all; color: #1f2937; } .footer { background: #f9fafb; border-top: 1px solid #e5e7eb; padding: 16px; text-align: center; font-size: 12px; color: #6b7280; } @@ -203,13 +207,18 @@ public class SportEasyEmailService {

Bonjour %s,

-

Afin d'assurer le suivi des entraînements, convocations et matchs pour la saison %s (catégorie %s), le club utilise la plateforme SportEasy.

-

Merci de rejoindre le groupe de votre catégorie en cliquant sur le bouton ci-dessous :

+

Afin d'assurer le suivi des entraînements, convocations et matchs pour la saison %s (catégorie %s), merci de rejoindre l'équipe sur la plateforme SportEasy en cliquant sur le lien ci-dessous :

+

- Rejoindre l'équipe SportEasy + Rejoindre la catégorie sur SportEasy

-

Si vous possédez déjà un compte SportEasy, connectez-vous avec vos identifiants puis rejoignez le groupe. Sinon, créez votre compte gratuitement en quelques secondes.

-

À très vite sur les terrains !
L'équipe de l'AS Talange

+ +
+ Lien d'invitation direct :
+ %s +
+ +

À très vite sur les terrains !
L'équipe de l'AS Talange

- - Lien d'invitation SportEasy de la catégorie + -

Saisissez le token du groupe SportEasy ou l'URL complète d'invitation.

+

Saisissez le lien direct d'invitation SportEasy spécifique à cette catégorie.