From d207b240f2ddd7fc27438a495020ba18890d6b42 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Thu, 14 Dec 2017 16:28:08 -0600 Subject: [PATCH] added support for changing the subject prefi --- config.js | 3 +++ docs/_docs/02-02-advanced-configuration.md | 8 +++++++- services/mailer.js | 5 +++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/config.js b/config.js index 76d488a0d..e14997be9 100644 --- a/config.js +++ b/config.js @@ -20,6 +20,9 @@ const CONFIG = { // WEBPACK indicates when webpack is currently building. WEBPACK: process.env.WEBPACK === 'TRUE', + // EMAIL_SUBJECT_PREFIX is the string before emails in the subject. + EMAIL_SUBJECT_PREFIX: process.env.TALK_EMAIL_SUBJECT_PREFIX || '[Talk]', + // When TRUE, it ensures that database indexes created in core will not add // indexes. CREATE_MONGO_INDEXES: process.env.DISABLE_CREATE_MONGO_INDEXES !== 'TRUE', diff --git a/docs/_docs/02-02-advanced-configuration.md b/docs/_docs/02-02-advanced-configuration.md index 94a6b402d..47be44fcc 100644 --- a/docs/_docs/02-02-advanced-configuration.md +++ b/docs/_docs/02-02-advanced-configuration.md @@ -460,4 +460,10 @@ Could be read as: ## TALK_DISABLE_IGNORE_FLAGS_AGAINST_STAFF When `TRUE`, staff members will have their accounts and comments moderated the -same as any other user in the system. (Default `FALSE`) \ No newline at end of file +same as any other user in the system. (Default `FALSE`) + +## TALK_EMAIL_SUBJECT_PREFIX + +The prefix for the subject of emails sent. An email with the specified subject +of `Email Confirmation` would then be sent as `[Talk] Email Confirmation`. +(Default `[Talk]`) \ No newline at end of file diff --git a/services/mailer.js b/services/mailer.js index 0a085ea4a..4433b9ef5 100644 --- a/services/mailer.js +++ b/services/mailer.js @@ -13,7 +13,8 @@ const { SMTP_USERNAME, SMTP_PORT, SMTP_PASSWORD, - SMTP_FROM_ADDRESS + SMTP_FROM_ADDRESS, + EMAIL_SUBJECT_PREFIX, } = require('../config'); // load all the templates as strings @@ -95,7 +96,7 @@ const mailer = module.exports = { } // Prefix the subject with `[Talk]`. - subject = `[Talk] ${subject}`; + subject = `${EMAIL_SUBJECT_PREFIX} ${subject}`; attachLocals(locals);