Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1706 from ppp0/issue-1706
Browse files Browse the repository at this point in the history
Move mail delivery agent configuration to protected function
  • Loading branch information
ppp0 committed Mar 24, 2015
2 parents e65b10c + 47da62d commit a630543
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion library/CM/Mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,16 @@ protected function _render($language) {
return $renderAdapter->fetch();
}

/**
* @return string|null
*/
protected function _getMailDeliveryAgent() {
return $this->_getConfig()->mailDeliveryAgent;
}

/**
* @throws CM_Exception_Invalid
*/
protected function _send($subject, $text, $html = null) {
if (!self::_getConfig()->send) {
$this->_log($subject, $text);
Expand All @@ -374,7 +384,7 @@ protected function _send($subject, $text, $html = null) {
foreach ($this->_bcc as $bcc) {
$mail->AddBCC($bcc['address'], $bcc['name']);
}
if ($mailDeliveryAgent = $this->_getConfig()->mailDeliveryAgent) {
if ($mailDeliveryAgent = $this->_getMailDeliveryAgent()) {
$mail->AddCustomHeader('X-MDA: ' . $mailDeliveryAgent);
}
$mail->SetFrom($this->_sender['address'], $this->_sender['name']);
Expand Down

0 comments on commit a630543

Please sign in to comment.