From 4c96aa5c95d284fb38bbb1d9e45b229b3de3699d Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Mon, 23 Nov 2020 18:34:17 +0000 Subject: [PATCH] Fixed bulk email only having 'bulk-email' tag in certain circumstances no issue - the `'bulk-email`' tag was only being added to bulk emails if another more specific tag was set up via config - we always want the `'bulk-email'` tag to be present for better event filtering --- core/server/services/bulk-email/mailgun.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/server/services/bulk-email/mailgun.js b/core/server/services/bulk-email/mailgun.js index cbb6c1be7d..8713d8afee 100644 --- a/core/server/services/bulk-email/mailgun.js +++ b/core/server/services/bulk-email/mailgun.js @@ -84,9 +84,11 @@ function send(message, recipientData, replacements) { messageData['v:email-id'] = message.id; } + const tags = ['bulk-email']; if (bulkEmailConfig && bulkEmailConfig.mailgun && bulkEmailConfig.mailgun.tag) { - messageData['o:tag'] = [bulkEmailConfig.mailgun.tag, 'bulk-email']; + tags.push(bulkEmailConfig.mailgun.tag); } + messageData['o:tag'] = tags; if (bulkEmailConfig && bulkEmailConfig.mailgun && bulkEmailConfig.mailgun.testmode) { messageData['o:testmode'] = true;