feat: simplify SportEasy invitation email to use direct category link
This commit is contained in:
+19
-8
@@ -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; }
|
||||
</style>
|
||||
</head>
|
||||
@@ -203,13 +207,18 @@ public class SportEasyEmailService {
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>Bonjour <strong>%s</strong>,</p>
|
||||
<p>Afin d'assurer le suivi des entraînements, convocations et matchs pour la saison <strong>%s</strong> (catégorie <strong>%s</strong>), le club utilise la plateforme <strong>SportEasy</strong>.</p>
|
||||
<p>Merci de rejoindre le groupe de votre catégorie en cliquant sur le bouton ci-dessous :</p>
|
||||
<p>Afin d'assurer le suivi des entraînements, convocations et matchs pour la saison <strong>%s</strong> (catégorie <strong>%s</strong>), merci de rejoindre l'équipe sur la plateforme <strong>SportEasy</strong> en cliquant sur le lien ci-dessous :</p>
|
||||
|
||||
<p style="text-align: center;">
|
||||
<a href="%s" class="btn" target="_blank">Rejoindre l'équipe SportEasy</a>
|
||||
<a href="%s" class="btn" target="_blank">Rejoindre la catégorie sur SportEasy</a>
|
||||
</p>
|
||||
<p>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.</p>
|
||||
<p>À très vite sur les terrains !<br><strong>L'équipe de l'AS Talange</strong></p>
|
||||
|
||||
<div class="url-box">
|
||||
<strong>Lien d'invitation direct :</strong><br>
|
||||
<a href="%s" style="color: #2563eb;">%s</a>
|
||||
</div>
|
||||
|
||||
<p style="margin-top: 20px;">À très vite sur les terrains !<br><strong>L'équipe de l'AS Talange</strong></p>
|
||||
</div>
|
||||
<div class="footer">
|
||||
Cet e-mail a été envoyé automatiquement par le système de gestion de l'AS Talange.
|
||||
@@ -221,6 +230,8 @@ public class SportEasyEmailService {
|
||||
adherentNom,
|
||||
saisonNom != null ? saisonNom : "",
|
||||
categorieNom,
|
||||
inviteUrl,
|
||||
inviteUrl,
|
||||
inviteUrl
|
||||
);
|
||||
}
|
||||
|
||||
@@ -65,10 +65,10 @@
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="sportEasyToken" class="block text-sm font-medium text-gray-700 mb-1">Token ou Lien d'invitation SportEasy</label>
|
||||
<input type="text" id="sportEasyToken" th:field="*{sportEasyToken}" placeholder="ex: https://www.sporteasy.net/join/ABC1234 ou juste ABC1234"
|
||||
<label for="sportEasyToken" class="block text-sm font-medium text-gray-700 mb-1">Lien d'invitation SportEasy de la catégorie</label>
|
||||
<input type="text" id="sportEasyToken" th:field="*{sportEasyToken}" placeholder="ex: https://www.sporteasy.net/join/XXXXXX"
|
||||
class="w-full border border-gray-300 rounded-lg px-4 py-2 text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none transition-colors">
|
||||
<p class="text-xs text-gray-500 mt-1">Saisissez le token du groupe SportEasy ou l'URL complète d'invitation.</p>
|
||||
<p class="text-xs text-gray-500 mt-1">Saisissez le lien direct d'invitation SportEasy spécifique à cette catégorie.</p>
|
||||
</div>
|
||||
|
||||
<div class="pt-4 border-t border-gray-100">
|
||||
|
||||
Reference in New Issue
Block a user