From 3491e60c9d606d62cb8e9b790e86abe3852a7e12 Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Fri, 24 Jul 2020 11:55:34 +0100 Subject: [PATCH] Added config to send bulk email in testmode - mailgun has a testmode flag we can use to get email to be accepted but not delivered - this is useful for developers testing general bulk email code - not for users - so it is only available via config --- core/server/services/bulk-email/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/server/services/bulk-email/index.js b/core/server/services/bulk-email/index.js index 91b47f154f..1b3f9f216f 100644 --- a/core/server/services/bulk-email/index.js +++ b/core/server/services/bulk-email/index.js @@ -104,6 +104,12 @@ module.exports = { }); } + if (bulkEmailConfig && bulkEmailConfig.mailgun && bulkEmailConfig.mailgun.testmode) { + Object.assign(batchData, { + 'o:testmode': true + }); + } + const messageData = Object.assign({}, message, batchData); // Rename plaintext field to text for Mailgun