From 8c5c696c514a5fb450462184240b21553d7f1532 Mon Sep 17 00:00:00 2001 From: Timothy Date: Sun, 25 Aug 2024 21:58:40 +0200 Subject: [PATCH] feat(email): add {email} placeholder to user invitation email (#564) * feat(email): add {email} placeholder to user invitation email * change default values and setting description --------- Co-authored-by: Elias Schneider --- backend/prisma/seed/config.seed.ts | 2 +- backend/src/email/email.service.ts | 3 ++- frontend/src/i18n/translations/en-US.ts | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/prisma/seed/config.seed.ts b/backend/prisma/seed/config.seed.ts index a88f4efc..7bc9c8f7 100644 --- a/backend/prisma/seed/config.seed.ts +++ b/backend/prisma/seed/config.seed.ts @@ -107,7 +107,7 @@ const configVariables: ConfigVariables = { inviteMessage: { type: "text", defaultValue: - "Hey!\n\nYou were invited to Pingvin Share. Click this link to accept the invite: {url}\n\nYour password is: {password}\n\nPingvin Share 🐧", + 'Hey!\n\nYou were invited to Pingvin Share. Click this link to accept the invite: {url}\n\nYou can use the email "{email}" and the password "{password}" to sign in.\n\nPingvin Share 🐧', }, }, smtp: { diff --git a/backend/src/email/email.service.ts b/backend/src/email/email.service.ts index e6dbe640..f532ff20 100644 --- a/backend/src/email/email.service.ts +++ b/backend/src/email/email.service.ts @@ -116,7 +116,8 @@ export class EmailService { this.config .get("email.inviteMessage") .replaceAll("{url}", loginUrl) - .replaceAll("{password}", password), + .replaceAll("{password}", password) + .replaceAll("{email}", recipientEmail), ); } diff --git a/frontend/src/i18n/translations/en-US.ts b/frontend/src/i18n/translations/en-US.ts index 5c476324..06047dc2 100644 --- a/frontend/src/i18n/translations/en-US.ts +++ b/frontend/src/i18n/translations/en-US.ts @@ -446,7 +446,7 @@ export default { "Subject of the email which gets sent when an admin invites a user.", "admin.config.email.invite-message": "Invite message", "admin.config.email.invite-message.description": - "Message which gets sent when an admin invites a user. {url} will be replaced with the invite URL and {password} with the password.", + "Message which gets sent when an admin invites a user. {url} will be replaced with the invite URL, {email} with the email and {password} with the password of the user.", "admin.config.share.allow-registration": "Allow registration", "admin.config.share.allow-registration.description":