From 330314356d3e64847d33a9fdf80bf8ab5816d79a Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 25 Jul 2023 13:28:26 +1200 Subject: [PATCH] dev/core#2907 parse subject for tokens --- CRM/Mailing/Event/BAO/MailingEventSubscribe.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/CRM/Mailing/Event/BAO/MailingEventSubscribe.php b/CRM/Mailing/Event/BAO/MailingEventSubscribe.php index 5fbcf34872..2451c617bb 100644 --- a/CRM/Mailing/Event/BAO/MailingEventSubscribe.php +++ b/CRM/Mailing/Event/BAO/MailingEventSubscribe.php @@ -197,7 +197,6 @@ SELECT civicrm_email.id as email_id $component->find(TRUE); $params = [ - 'subject' => $component->subject, 'from' => "\"{$domainEmailName}\" <{$domainEmailAddress}>", 'toEmail' => $email, 'replyTo' => $confirm, @@ -237,18 +236,18 @@ SELECT civicrm_email.id as email_id $tokenProcessor->addMessage('body_html', $html, 'text/html'); $tokenProcessor->addMessage('body_text', $text, 'text/plain'); + $tokenProcessor->addMessage('subject', $component->subject, 'text/plain'); $tokenProcessor->addRow(['contactId' => $this->contact_id, 'groupId' => $this->group_id]); $tokenProcessor->evaluate(); - $html = $tokenProcessor->getRow(0)->render('body_html'); - $text = $tokenProcessor->getRow(0)->render('body_text'); + $params['html'] = $tokenProcessor->getRow(0)->render('body_html'); + $params['text'] = $tokenProcessor->getRow(0)->render('body_text'); + $params['subject'] = $tokenProcessor->getRow(0)->render('subject'); CRM_Mailing_BAO_Mailing::addMessageIdHeader($params, 's', $this->contact_id, $this->id, $this->hash ); - $params['html'] = $html; - $params['text'] = $text; if (CRM_Core_BAO_MailSettings::includeMessageId()) { $params['messageId'] = $params['Message-ID']; } -- 2.25.1