Skip to content

Commit

Permalink
Removed rendering of subject
Browse files Browse the repository at this point in the history
  • Loading branch information
bencroker committed Mar 2, 2024
1 parent 82477e7 commit 8a544b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 1 addition & 5 deletions src/services/SendoutsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);

Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 8a544b4

Please sign in to comment.