Add reply_to property and send it to email backend

This commit is contained in:
Tomasz Jakubowski 2019-03-12 22:24:02 +01:00 committed by GitHub
parent a5455c3d76
commit 4ac8b8016d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -112,6 +112,12 @@ class notifications {
*/ */
protected $sender; protected $sender;
/**
* email address for reply to
* @var string
*/
protected $reply_to;
/** /**
* holds notification subject * holds notification subject
* @var string * @var string
@ -229,6 +235,16 @@ class notifications {
return false; return false;
} }
/**
* Set reply_to for the current notification
*
* @param $_reply_to string for email address to reply to
*/
public function set_reply_to($_reply_to) {
$this->reply_to = $_reply_to;
return true;
}
/** /**
* Set receivers for the current notification * Set receivers for the current notification
* *
@ -550,6 +566,8 @@ class notifications {
if (!empty($this->popupsubject)) $lsubject = $this->popupsubject; if (!empty($this->popupsubject)) $lsubject = $this->popupsubject;
if ($this->popup_links) $llinks = $this->popup_links; if ($this->popup_links) $llinks = $this->popup_links;
if (is_array($this->popup_data)) $popup_data = $this->popup_data; if (is_array($this->popup_data)) $popup_data = $this->popup_data;
} elseif ($backend == 'email') {
if (!empty($this->reply_to)) $popup_data = array( 'reply_to' => $this->reply_to );
} }
$obj->send($this->prepend_message($messages, $prepend_message), $lsubject, $llinks, $this->attachments, $popup_data); $obj->send($this->prepend_message($messages, $prepend_message), $lsubject, $llinks, $this->attachments, $popup_data);