Skip to content

Commit

Permalink
Merge pull request #32 from jmcd73/dev-4.x
Browse files Browse the repository at this point in the history
Check for h: headers in _processHeaders and add to $this->_formData
  • Loading branch information
challgren authored Dec 23, 2019
2 parents 834d2fc + 935d18a commit 8436832
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Mailer/Transport/MailgunTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* For full copyright and license information, please see the LICENSE.md
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Narendra Vaghela (http://www.narendravaghela.com)
* @copyright 2020 Copyright (c) Narendra Vaghela (http://www.narendravaghela.com)
* @license https://opensource.org/licenses/mit-license.php MIT License
* @link https://github.com/narendravaghela/cakephp-mailgun
* @since 1.0.0
Expand Down Expand Up @@ -57,8 +57,14 @@ class MailgunTransport extends AbstractTransport
'skip-verification',
];

/**
* @var string
*/
protected $_mailgunHeaderPrefix = 'X-Mailgun';

/**
* @var array
*/
protected $_mailgunHeaders = [
'X-Mailgun-Tag' => 'tag',
'X-Mailgun-Dkim' => 'dkim',
Expand Down Expand Up @@ -428,6 +434,8 @@ protected function _processHeaders(Email $email)
$var = $this->_mailgunHeaders[$header];
$this->_formData->add("{$this->_optionPrefix}$var", $value);
}
} elseif (0 === strpos($header, $this->_customHeaderPrefix) && !empty($value)) {
$this->_formData->add($header, $value);
}
}
}
Expand Down

0 comments on commit 8436832

Please sign in to comment.