Skip to content

Commit

Permalink
Merge pull request #2229 from trob/cron-email2
Browse files Browse the repository at this point in the history
Cron email: add placeholers to ReplyTo; improve testmode infos
  • Loading branch information
trob committed Feb 13, 2021
2 parents 79889ec + 73bcde2 commit f044aed
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions plugins/fabrik_cron/email/email.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,15 @@ public function process(&$data, &$listModel)
}

$thisSubject = $w->parseMessageForPlaceHolder($subject, $row);
$thisReplyTo = $w->parseMessageForPlaceHolder($replyTo, $row);
$thisReplyToName = $w->parseMessageForPlaceHolder($replyToName, $row);

if ($testMode)
{
$this->app->enqueueMessage($x . ': Would send subject: ' . $thisSubject);
$this->app->enqueueMessage($x . ': Would send to: ' . $thisTo);
$this->app->enqueueMessage($x . ': Would send Reply to: ' . $thisReplyTo);
$this->app->enqueueMessage($x . ': Would send Reply to name: ' . $thisReplyToName);
}
else
{
Expand All @@ -142,20 +146,20 @@ public function process(&$data, &$listModel)
null,
null,
null,
$replyTo,
$replyToName
$thisReplyTo,
$thisReplyToName
);

if (!$res)
{
//$this->log .= "\n failed sending to $thisTo";
FabrikWorker::log('plg.cron.email.information', 'Failed sending to: ' . $thisTo);
FabrikWorker::log('plg.cron.email.information', $row['__pk_val'].' Failed sending to: ' . $thisTo);
$failedIds[] = $row['__pk_val'];
}
else
{
//$this->log .= "\n sent to $thisTo";
FabrikWorker::log('plg.cron.email.information', 'Sent to: ' . $thisTo);
FabrikWorker::log('plg.cron.email.information', $row['__pk_val'].' Sent to: ' . $thisTo.' Replyto: '.$thisReplyTo);
$sentIds[] = $row['__pk_val'];
}
}
Expand Down

0 comments on commit f044aed

Please sign in to comment.