diff --git a/CHANGELOG.md b/CHANGELOG.md index af4435de..5e107bac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Release Notes for Campaign +## 2.12.2 - Unreleased + +### Changed + +- Sendouts no longer allow contact field values to be used in the subject. + ## 2.12.1 - 2024-01-08 ### Changed diff --git a/src/services/SendoutsService.php b/src/services/SendoutsService.php index d6b9c24c..806d647e 100755 --- a/src/services/SendoutsService.php +++ b/src/services/SendoutsService.php @@ -190,9 +190,6 @@ public function sendTest(SendoutElement $sendout, ContactElement $contact): bool // Set the current site from the sendout's site ID Craft::$app->getSites()->setCurrentSite($sendout->siteId); - // Get subject - $subject = Craft::$app->getView()->renderString($sendout->subject, ['contact' => $contact]); - // Get body, catching template rendering errors try { $htmlBody = $campaign->getHtmlBody($contact, $sendout); @@ -213,7 +210,7 @@ public function sendTest(SendoutElement $sendout, ContactElement $contact): bool $message = Campaign::$plugin->mailer->compose() ->setFrom([$sendout->fromEmail => $sendout->fromName]) ->setTo($contact->email) - ->setSubject('[Test] ' . $subject) + ->setSubject('[Test] ' . $sendout->subject) ->setHtmlBody($htmlBody) ->setTextBody($plaintextBody); @@ -259,7 +256,6 @@ public function sendEmail(SendoutElement $sendout, ContactElement $contact, int } elseif ($contactCampaignRecord->sent !== null) { // Ensure this is a recurring sendout that can be sent to contacts multiple times $schedule = $sendout->getSchedule(); - if (!($sendout->sendoutType == 'recurring' && $schedule->canSendToContactsMultipleTimes)) { return; }