From 8e654f4b0b775f34db051017c4c41a592643a11c Mon Sep 17 00:00:00 2001 From: Rich Lott / Artful Robot Date: Fri, 2 Aug 2019 13:55:11 +0100 Subject: [PATCH] Change way headers are added to message to use explicit headers key as this seems to be more generally implemented --- mailgunny.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mailgunny.php b/mailgunny.php index 9f266f8..328fa5b 100644 --- a/mailgunny.php +++ b/mailgunny.php @@ -142,11 +142,11 @@ function mailgunny_civicrm_entityTypes(&$entityTypes) { function mailgunny_civicrm_alterMailParams(&$params, $context) { if (isset($params['X-CiviMail-Bounce'])) { // Copy this header to one that will be returned by Mailgun's webhook. - $params['X-Mailgun-Variables'] = json_encode(['civimail-bounce' => $params['X-CiviMail-Bounce']]); + $params['headers']['X-Mailgun-Variables'] = json_encode(['civimail-bounce' => $params['X-CiviMail-Bounce']]); } elseif (isset($params['Return-Path'])) { // Copy this header to one that will be returned by Mailgun's webhook. - $params['X-Mailgun-Variables'] = json_encode(['civimail-bounce' => $params['Return-Path']]); + $params['headers']['X-Mailgun-Variables'] = json_encode(['civimail-bounce' => $params['Return-Path']]); } else { // Probably a single email, for which we don't have any useful information to add.