From 50bc62428ef4987959b6e63b0074aaf056b99d83 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Wed, 7 May 2025 19:42:39 +0200 Subject: [PATCH] fix(backend): correct email from (#8501) --- .../sendChatMessageMail.spec.ts.snap | 4 +-- .../sendEmailVerification.spec.ts.snap | 4 +-- .../sendNotificationMail.spec.ts.snap | 36 +++++++++---------- .../sendRegistrationMail.spec.ts.snap | 8 ++--- .../sendResetPasswordMail.spec.ts.snap | 4 +-- .../__snapshots__/sendWrongEmail.spec.ts.snap | 4 +-- backend/src/emails/sendEmail.ts | 4 ++- 7 files changed, 33 insertions(+), 31 deletions(-) diff --git a/backend/src/emails/__snapshots__/sendChatMessageMail.spec.ts.snap b/backend/src/emails/__snapshots__/sendChatMessageMail.spec.ts.snap index 57b256a12..786bad9c0 100644 --- a/backend/src/emails/__snapshots__/sendChatMessageMail.spec.ts.snap +++ b/backend/src/emails/__snapshots__/sendChatMessageMail.spec.ts.snap @@ -3,7 +3,7 @@ exports[`sendChatMessageMail English chat_message template 1`] = ` { "attachments": [], - "from": "ocelot.social", + "from": "ocelot.social ", "html": " @@ -130,7 +130,7 @@ ocelot.social Community [https://ocelot.social]", exports[`sendChatMessageMail German chat_message template 1`] = ` { "attachments": [], - "from": "ocelot.social", + "from": "ocelot.social ", "html": " diff --git a/backend/src/emails/__snapshots__/sendEmailVerification.spec.ts.snap b/backend/src/emails/__snapshots__/sendEmailVerification.spec.ts.snap index 34c945d65..87815f5e6 100644 --- a/backend/src/emails/__snapshots__/sendEmailVerification.spec.ts.snap +++ b/backend/src/emails/__snapshots__/sendEmailVerification.spec.ts.snap @@ -3,7 +3,7 @@ exports[`sendEmailVerification English renders correctly 1`] = ` { "attachments": [], - "from": "ocelot.social", + "from": "ocelot.social ", "html": " @@ -133,7 +133,7 @@ ocelot.social Community [https://ocelot.social]", exports[`sendEmailVerification German renders correctly 1`] = ` { "attachments": [], - "from": "ocelot.social", + "from": "ocelot.social ", "html": " diff --git a/backend/src/emails/__snapshots__/sendNotificationMail.spec.ts.snap b/backend/src/emails/__snapshots__/sendNotificationMail.spec.ts.snap index 0fec27b7c..1c4f0dc8e 100644 --- a/backend/src/emails/__snapshots__/sendNotificationMail.spec.ts.snap +++ b/backend/src/emails/__snapshots__/sendNotificationMail.spec.ts.snap @@ -3,7 +3,7 @@ exports[`sendNotificationMail English changed_group_member_role template 1`] = ` { "attachments": [], - "from": "ocelot.social", + "from": "ocelot.social ", "html": " @@ -129,7 +129,7 @@ ocelot.social Community [https://ocelot.social]", exports[`sendNotificationMail English commented_on_post template 1`] = ` { "attachments": [], - "from": "ocelot.social", + "from": "ocelot.social ", "html": " @@ -257,7 +257,7 @@ ocelot.social Community [https://ocelot.social]", exports[`sendNotificationMail English followed_user_posted template 1`] = ` { "attachments": [], - "from": "ocelot.social", + "from": "ocelot.social ", "html": " @@ -385,7 +385,7 @@ ocelot.social Community [https://ocelot.social]", exports[`sendNotificationMail English mentioned_in_comment template 1`] = ` { "attachments": [], - "from": "ocelot.social", + "from": "ocelot.social ", "html": " @@ -513,7 +513,7 @@ ocelot.social Community [https://ocelot.social]", exports[`sendNotificationMail English mentioned_in_post template 1`] = ` { "attachments": [], - "from": "ocelot.social", + "from": "ocelot.social ", "html": " @@ -640,7 +640,7 @@ ocelot.social Community [https://ocelot.social]", exports[`sendNotificationMail English post_in_group template 1`] = ` { "attachments": [], - "from": "ocelot.social", + "from": "ocelot.social ", "html": " @@ -766,7 +766,7 @@ ocelot.social Community [https://ocelot.social]", exports[`sendNotificationMail English removed_user_from_group template 1`] = ` { "attachments": [], - "from": "ocelot.social", + "from": "ocelot.social ", "html": " @@ -889,7 +889,7 @@ ocelot.social Community [https://ocelot.social]", exports[`sendNotificationMail English user_joined_group template 1`] = ` { "attachments": [], - "from": "ocelot.social", + "from": "ocelot.social ", "html": " @@ -1016,7 +1016,7 @@ ocelot.social Community [https://ocelot.social]", exports[`sendNotificationMail English user_left_group template 1`] = ` { "attachments": [], - "from": "ocelot.social", + "from": "ocelot.social ", "html": " @@ -1143,7 +1143,7 @@ ocelot.social Community [https://ocelot.social]", exports[`sendNotificationMail German changed_group_member_role template 1`] = ` { "attachments": [], - "from": "ocelot.social", + "from": "ocelot.social ", "html": " @@ -1269,7 +1269,7 @@ ocelot.social Community [https://ocelot.social]", exports[`sendNotificationMail German commented_on_post template 1`] = ` { "attachments": [], - "from": "ocelot.social", + "from": "ocelot.social ", "html": " @@ -1397,7 +1397,7 @@ ocelot.social Community [https://ocelot.social]", exports[`sendNotificationMail German followed_user_posted template 1`] = ` { "attachments": [], - "from": "ocelot.social", + "from": "ocelot.social ", "html": " @@ -1525,7 +1525,7 @@ ocelot.social Community [https://ocelot.social]", exports[`sendNotificationMail German mentioned_in_comment template 1`] = ` { "attachments": [], - "from": "ocelot.social", + "from": "ocelot.social ", "html": " @@ -1653,7 +1653,7 @@ ocelot.social Community [https://ocelot.social]", exports[`sendNotificationMail German mentioned_in_post template 1`] = ` { "attachments": [], - "from": "ocelot.social", + "from": "ocelot.social ", "html": " @@ -1780,7 +1780,7 @@ ocelot.social Community [https://ocelot.social]", exports[`sendNotificationMail German post_in_group template 1`] = ` { "attachments": [], - "from": "ocelot.social", + "from": "ocelot.social ", "html": " @@ -1906,7 +1906,7 @@ ocelot.social Community [https://ocelot.social]", exports[`sendNotificationMail German removed_user_from_group template 1`] = ` { "attachments": [], - "from": "ocelot.social", + "from": "ocelot.social ", "html": " @@ -2029,7 +2029,7 @@ ocelot.social Community [https://ocelot.social]", exports[`sendNotificationMail German user_joined_group template 1`] = ` { "attachments": [], - "from": "ocelot.social", + "from": "ocelot.social ", "html": " @@ -2156,7 +2156,7 @@ ocelot.social Community [https://ocelot.social]", exports[`sendNotificationMail German user_left_group template 1`] = ` { "attachments": [], - "from": "ocelot.social", + "from": "ocelot.social ", "html": " diff --git a/backend/src/emails/__snapshots__/sendRegistrationMail.spec.ts.snap b/backend/src/emails/__snapshots__/sendRegistrationMail.spec.ts.snap index 3b8d1c077..d4a1ded8a 100644 --- a/backend/src/emails/__snapshots__/sendRegistrationMail.spec.ts.snap +++ b/backend/src/emails/__snapshots__/sendRegistrationMail.spec.ts.snap @@ -3,7 +3,7 @@ exports[`sendRegistrationMail with invite code English renders correctly 1`] = ` { "attachments": [], - "from": "ocelot.social", + "from": "ocelot.social ", "html": " @@ -142,7 +142,7 @@ ocelot.social Community [https://ocelot.social]", exports[`sendRegistrationMail with invite code German renders correctly 1`] = ` { "attachments": [], - "from": "ocelot.social", + "from": "ocelot.social ", "html": " @@ -282,7 +282,7 @@ ocelot.social Community [https://ocelot.social]", exports[`sendRegistrationMail without invite code English renders correctly 1`] = ` { "attachments": [], - "from": "ocelot.social", + "from": "ocelot.social ", "html": " @@ -421,7 +421,7 @@ ocelot.social Community [https://ocelot.social]", exports[`sendRegistrationMail without invite code German renders correctly 1`] = ` { "attachments": [], - "from": "ocelot.social", + "from": "ocelot.social ", "html": " diff --git a/backend/src/emails/__snapshots__/sendResetPasswordMail.spec.ts.snap b/backend/src/emails/__snapshots__/sendResetPasswordMail.spec.ts.snap index 3d8c6ac27..da62c9a34 100644 --- a/backend/src/emails/__snapshots__/sendResetPasswordMail.spec.ts.snap +++ b/backend/src/emails/__snapshots__/sendResetPasswordMail.spec.ts.snap @@ -3,7 +3,7 @@ exports[`sendResetPasswordMail English renders correctly 1`] = ` { "attachments": [], - "from": "ocelot.social", + "from": "ocelot.social ", "html": " @@ -132,7 +132,7 @@ ocelot.social Community [https://ocelot.social]", exports[`sendResetPasswordMail German renders correctly 1`] = ` { "attachments": [], - "from": "ocelot.social", + "from": "ocelot.social ", "html": " diff --git a/backend/src/emails/__snapshots__/sendWrongEmail.spec.ts.snap b/backend/src/emails/__snapshots__/sendWrongEmail.spec.ts.snap index 72acc52cd..b2052d808 100644 --- a/backend/src/emails/__snapshots__/sendWrongEmail.spec.ts.snap +++ b/backend/src/emails/__snapshots__/sendWrongEmail.spec.ts.snap @@ -3,7 +3,7 @@ exports[`sendWrongEmail English renders correctly 1`] = ` { "attachments": [], - "from": "ocelot.social", + "from": "ocelot.social ", "html": " @@ -130,7 +130,7 @@ ocelot.social Community [https://ocelot.social]", exports[`sendWrongEmail German renders correctly 1`] = ` { "attachments": [], - "from": "ocelot.social", + "from": "ocelot.social ", "html": " diff --git a/backend/src/emails/sendEmail.ts b/backend/src/emails/sendEmail.ts index 8e5d8e83c..580cc2f58 100644 --- a/backend/src/emails/sendEmail.ts +++ b/backend/src/emails/sendEmail.ts @@ -28,11 +28,13 @@ const defaultParams = { renderSettingsUrl: true, } +const from = `${CONFIG.APPLICATION_NAME} <${CONFIG.EMAIL_DEFAULT_SENDER}>` + const transport = createTransport(nodemailerTransportOptions) const email = new Email({ message: { - from: `${CONFIG.APPLICATION_NAME}`, + from, }, transport, i18n: {