From 95d232307ead81b2230dbf76174e32cb2423faee Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Sat, 19 Oct 2024 14:57:48 +0200 Subject: [PATCH 1/2] Make support email addresses configurable Previously the address where help requests and feedback were sent to was hardcoded to support@citizenos.com. Now it can be configured via the config json. --- config/default.json | 2 ++ libs/email.js | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config/default.json b/config/default.json index ee0b06182..2495c9f9d 100644 --- a/config/default.json +++ b/config/default.json @@ -100,6 +100,8 @@ } }, "from": "Citizen OS ", + "supportTo": "support@citizenos.com", + "feedbackTo": "support@citizenos.com", "linkToPrivacyPolicy": "https://app.citizenos.com/en/topics/7abdd244-d45b-40d3-997c-a6290d4e972c", "linkViewModerationGuidelines": "https://app.citizenos.com/en/topics/ac8b66a4-ca56-4d02-8406-5e19da73d7ce", "trap": false, diff --git a/libs/email.js b/libs/email.js index a9d7e84a2..9276b203d 100644 --- a/libs/email.js +++ b/libs/email.js @@ -341,7 +341,7 @@ module.exports = function (app) { _.cloneDeep(EMAIL_OPTIONS_DEFAULT), // Deep clone to guarantee no funky business messing with the class level defaults, cant use Object.assign({}.. as this is not a deep clone. { subject: 'Help request', - to: ['support@citizenos.com'], + to: [config.email.supportTo], replyTo: debugData.email, from: "no-reply@citizenos.com", linkedData: { @@ -369,7 +369,7 @@ module.exports = function (app) { _.cloneDeep(EMAIL_OPTIONS_DEFAULT), // Deep clone to guarantee no funky business messing with the class level defaults, cant use Object.assign({}.. as this is not a deep clone. { subject: 'Feedback', - to: ['support@citizenos.com'], + to: [config.email.feedbackTo], from: "no-reply@citizenos.com", linkedData: { translations: template.translations, From 99a1fb2a88da165be0b8d8d13589a7e92cd4814d Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Sat, 19 Oct 2024 14:59:51 +0200 Subject: [PATCH 2/2] FIX configuration of e-mail from address This address was configurable via the config json and then passed to the e-mail provider, but when actually sending e-mails, a harcoded no-reply@citizen-os.com was passed which overrides the configured value. This removes the overrides so the configured value takes effect as expected. --- libs/email.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libs/email.js b/libs/email.js index 9276b203d..d635dc278 100644 --- a/libs/email.js +++ b/libs/email.js @@ -343,7 +343,6 @@ module.exports = function (app) { subject: 'Help request', to: [config.email.supportTo], replyTo: debugData.email, - from: "no-reply@citizenos.com", linkedData: { translations: template.translations, }, @@ -370,7 +369,6 @@ module.exports = function (app) { { subject: 'Feedback', to: [config.email.feedbackTo], - from: "no-reply@citizenos.com", linkedData: { translations: template.translations, }, @@ -410,7 +408,6 @@ module.exports = function (app) { { subject: template.translations.ACCOUNT_VERIFICATION.SUBJECT, to: user.email, - from: "no-reply@citizenos.com", //Placeholders toUser: user, linkVerify: linkVerify @@ -450,7 +447,6 @@ module.exports = function (app) { { subject: template.translations.PASSWORD_RESET.SUBJECT, to: user.email, - from: "no-reply@citizenos.com", //Placeholders.. toUser: user, linkReset: urlLib.getFe('/account/password/reset/:passwordResetCode', { passwordResetCode: passwordResetCode }, { email: user.email })