Skip to content

Commit c8ecd05

Browse files
Changed template for invitation
1 parent 3c6812e commit c8ecd05

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

controller/auth/kratos.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,15 @@
2626
KRATOS_IDENTITY_CACHE_TIMEOUT = timedelta(minutes=30)
2727

2828
LANGUAGE_MESSAGES = {
29-
"en": "Welcome! Click the link to complete your account setup:\n\n",
30-
"de": "Willkommen! Klicken Sie auf den Link, um Ihre Kontoeinrichtung abzuschließen:\n\n",
31-
"nl": "Welkom! Klik op de link om uw accountinstellingen te voltooien:\n\n",
29+
"en": "Hello!\n\nClick the link to complete your account setup:\n\n",
30+
"de": "Hallo!\n\nKlicken Sie auf den Link, um Ihre Kontoeinrichtung abzuschließen:\n\n",
3231
}
3332

34-
LANGUAGE_SUBJECTS = {
35-
"en": "You're invited to our app!",
36-
"de": "Sie sind zu unserer App eingeladen!",
37-
"nl": "U bent uitgenodigd voor onze app!",
38-
}
33+
INVITATION_SUBJECT = "Sie sind zu unserer app eingeladen/You are invited to our app"
3934

4035
LANGUAGE_EXPIRATION_INFO = {
4136
"en": "This link can only be clicked once and is valid for 2 days. Contact your system admin if you have issues.",
4237
"de": "Dieser Link kann nur einmal angeklickt werden und ist 2 Tage lang gültig. Kontaktieren Sie Ihren Systemadministrator, wenn Sie Probleme haben.",
43-
"nl": "Deze link kan maar één keer worden aangeklikt en is 2 dagen geldig. Neem contact op met uw systeembeheerder als u problemen ondervindt.",
4438
}
4539

4640

@@ -255,11 +249,11 @@ def get_recovery_link(user_id: str) -> str:
255249
return response_link.json() if response_link.ok else None
256250

257251

258-
def email_with_link(to_email: str, recovery_link: str, language: str) -> None:
252+
def email_with_link(to_email: str, recovery_link: str) -> None:
259253
msg = MIMEText(
260-
f"{LANGUAGE_MESSAGES[language]}{recovery_link}\n\n{LANGUAGE_EXPIRATION_INFO[language]}"
254+
f"{LANGUAGE_MESSAGES['de']}{recovery_link}\n\n{LANGUAGE_EXPIRATION_INFO['de']}\n\n\n------\n\n{LANGUAGE_MESSAGES['en']}{recovery_link}\n\n{LANGUAGE_EXPIRATION_INFO['en']}",
261255
)
262-
msg["Subject"] = LANGUAGE_SUBJECTS[language]
256+
msg["Subject"] = INVITATION_SUBJECT
263257
msg["From"] = "no-reply@kern.ai"
264258
msg["To"] = to_email
265259

controller/auth/manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def invite_users(
202202
raise AuthManagerError("Failed to get recovery link")
203203

204204
# Send the recovery link to the email
205-
kratos.email_with_link(email, recovery_link["recovery_link"], language)
205+
kratos.email_with_link(email, recovery_link["recovery_link"])
206206
return user_ids
207207

208208

0 commit comments

Comments
 (0)