Set replyTo header when it is set

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

View File

@ -90,8 +90,6 @@ class notifications_email implements notifications_iface {
*/ */
public function send(array $_messages, $_subject = false, $_links = false, $_attachments = false, $_data = false) public function send(array $_messages, $_subject = false, $_links = false, $_attachments = false, $_data = false)
{ {
unset ($_data);
$body_plain = $_messages['plain'].$this->render_links($_links, false, $this->preferences->external_mailclient); $body_plain = $_messages['plain'].$this->render_links($_links, false, $this->preferences->external_mailclient);
$body_html = "<html><body>\n".$_messages['html'].$this->render_links($_links, true, $this->preferences->external_mailclient)."</body>\n</html>\n"; $body_html = "<html><body>\n".$_messages['html'].$this->render_links($_links, true, $this->preferences->external_mailclient)."</body>\n</html>\n";
@ -106,6 +104,10 @@ class notifications_email implements notifications_iface {
$this->mail->setFrom($this->sender->account_email, $this->sender->account_fullname); $this->mail->setFrom($this->sender->account_email, $this->sender->account_fullname);
if ( $_data && isset( $_data['reply_to'] ) ) {
$this->mail->addAddress($_data['reply_to'], '', 'replyto');
}
$this->mail->addHeader('Subject', trim($_subject)); // trim the subject to avoid strange wrong encoding problem $this->mail->addHeader('Subject', trim($_subject)); // trim the subject to avoid strange wrong encoding problem
if ($_messages['html']) if ($_messages['html'])
{ {