From af43c0872c40d8fa7f48ec0d290d4b89e366c107 Mon Sep 17 00:00:00 2001 From: Rish Date: Wed, 13 Nov 2019 17:01:37 +0530 Subject: [PATCH] Fixed mailgun not sending test emails due to empty recipient variables no issue Mailgun expects `recipient-variables` to be a json object and fails to attempt sending the message in case its undefined, which is the case for test emails as they don't have member `uuid` or `unsubscribe` url. This sets a default empty object for `recipent-variables` in case of no data. --- core/server/services/bulk-email/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/server/services/bulk-email/index.js b/core/server/services/bulk-email/index.js index e02782e466..380422844b 100644 --- a/core/server/services/bulk-email/index.js +++ b/core/server/services/bulk-email/index.js @@ -49,7 +49,7 @@ module.exports = { * @param {[object]} recipientData - list of data keyed by email to inject into the email * @returns {Promise>} An array of promises representing the success of the batch email sending */ - async send(message, recipients, recipientData) { + async send(message, recipients, recipientData = {}) { let BATCH_SIZE = 1000; if (!mailgunInstance) {