Skip to content

Commit

Permalink
Merge pull request #26526 from reflexive-communications/open-tracker-…
Browse files Browse the repository at this point in the history
…legacy-check

FlexMailer\Listener\OpenTracker: remove deprecated isLegacy check
  • Loading branch information
eileenmcnaughton authored Jun 14, 2023
2 parents e2129b4 + ac05277 commit ffc0410
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions ext/flexmailer/src/Listener/OpenTracker.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,12 @@ public function onCompose(ComposeBatchEvent $e) {
return;
}

$config = \CRM_Core_Config::singleton();

// TODO: After v5.21 goes EOL, remove the $isLegacy check.
$isLegacy = version_compare(\CRM_Utils_System::version(), '5.23.alpha', '<');

foreach ($e->getTasks() as $task) {
/** @var \Civi\FlexMailer\FlexMailerTask $task */
$mailParams = $task->getMailParams();

if (!empty($mailParams) && !empty($mailParams['html'])) {
$openUrl = $isLegacy
? $config->userFrameworkResourceURL . "extern/open.php?q=" . $task->getEventQueueId()
: \CRM_Utils_System::externUrl('extern/open', "q=" . $task->getEventQueueId());

$openUrl = \CRM_Utils_System::externUrl('extern/open', 'q=' . $task->getEventQueueId());
$mailParams['html'] .= "\n" . '<img src="' . htmlentities($openUrl) . "\" width='1' height='1' alt='' border='0'>";

$task->setMailParams($mailParams);
Expand Down

0 comments on commit ffc0410

Please sign in to comment.