Change way headers are added to message to use explicit headers key as this seems to be more generally implemented
This commit is contained in:
parent
9f354a5217
commit
8e654f4b0b
@ -142,11 +142,11 @@ function mailgunny_civicrm_entityTypes(&$entityTypes) {
|
|||||||
function mailgunny_civicrm_alterMailParams(&$params, $context) {
|
function mailgunny_civicrm_alterMailParams(&$params, $context) {
|
||||||
if (isset($params['X-CiviMail-Bounce'])) {
|
if (isset($params['X-CiviMail-Bounce'])) {
|
||||||
// Copy this header to one that will be returned by Mailgun's webhook.
|
// 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'])) {
|
elseif (isset($params['Return-Path'])) {
|
||||||
// Copy this header to one that will be returned by Mailgun's webhook.
|
// 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 {
|
else {
|
||||||
// Probably a single email, for which we don't have any useful information to add.
|
// Probably a single email, for which we don't have any useful information to add.
|
||||||
|
Loading…
Reference in New Issue
Block a user