From cabaee588b50877872d210c870bfb9c95b541921 Mon Sep 17 00:00:00 2001 From: Elias Schneider Date: Fri, 23 Dec 2022 10:57:09 +0100 Subject: [PATCH] feat: custom mail subject --- backend/prisma/seed/config.seed.ts | 12 ++++++++++-- backend/src/email/email.service.ts | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/backend/prisma/seed/config.seed.ts b/backend/prisma/seed/config.seed.ts index 6ae546b..a6dda01 100644 --- a/backend/prisma/seed/config.seed.ts +++ b/backend/prisma/seed/config.seed.ts @@ -69,9 +69,17 @@ const configVariables: Prisma.ConfigCreateInput[] = [ }, { key: "EMAIL_MESSAGE", - description: "Message which gets sent to the recipients. {creator} and {shareUrl} will be replaced with the creator's name and the share URL.", + description: + "Message which gets sent to the recipients. {creator} and {shareUrl} will be replaced with the creator's name and the share URL.", type: "text", - value: "Hey!\n{creator} shared some files with you. View or download the files with this link: {shareUrl}\nShared securely with Pingvin Share 🐧", + value: + "Hey!\n{creator} shared some files with you. View or download the files with this link: {shareUrl}\nShared securely with Pingvin Share 🐧", + }, + { + key: "EMAIL_SUBJECT", + description: "Subject of the email which gets sent to the recipients.", + type: "string", + value: "Files shared with you", }, { key: "SMTP_HOST", diff --git a/backend/src/email/email.service.ts b/backend/src/email/email.service.ts index 2f36d94..411099d 100644 --- a/backend/src/email/email.service.ts +++ b/backend/src/email/email.service.ts @@ -27,7 +27,7 @@ export class EmailService { await transporter.sendMail({ from: `"Pingvin Share" <${this.config.get("SMTP_EMAIL")}>`, to: recipientEmail, - subject: "Files shared with you", + subject: this.config.get("EMAIL_SUBJECT"), text: this.config .get("EMAIL_MESSAGE") .replaceAll("\\n", "\n")