- Implements return path for SMTP/PHPMail/AmazonSES

This commit is contained in:
Vlad
2016-12-23 11:09:10 -05:00
parent 456152b5cb
commit c651a8bbe8
8 changed files with 94 additions and 18 deletions

View File

@@ -14,11 +14,12 @@ class SMTP {
public $encryption;
public $sender;
public $reply_to;
public $return_path;
public $mailer;
function __construct(
$host, $port, $authentication, $login = null, $password = null, $encryption,
$sender, $reply_to) {
$sender, $reply_to, $return_path) {
$this->host = $host;
$this->port = $port;
$this->authentication = $authentication;
@@ -27,6 +28,9 @@ class SMTP {
$this->encryption = $encryption;
$this->sender = $sender;
$this->reply_to = $reply_to;
$this->return_path = ($return_path) ?
$return_path :
$this->sender['from_email'];
$this->mailer = $this->buildMailer();
}
@@ -65,6 +69,7 @@ class SMTP {
->setReplyTo(array(
$this->reply_to['reply_to_email'] => $this->reply_to['reply_to_name']
))
->setReturnPath($this->return_path)
->setSubject($newsletter['subject']);
if(!empty($newsletter['body']['html'])) {
$message = $message->setBody($newsletter['body']['html'], 'text/html');