Skip to content

Commit

Permalink
Added reply-to settings for email cron plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
cheesegrits committed Aug 30, 2017
1 parent acba69e commit f2f5bd8
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
17 changes: 15 additions & 2 deletions plugins/fabrik_cron/email/email.php
Expand Up @@ -56,6 +56,8 @@ public function process(&$data, &$listModel)
$w = new FabrikWorker;
($params->get('cronemail_return', '') != '') ? $MailFrom = $params->get('cronemail_return') : $MailFrom = $this->app->get('mailfrom');
($params->get('cronemail_from', '') != '') ? $FromName = $params->get('cronemail_from') : $FromName = $this->app->get('fromname');
($params->get('cronemail_replyto', '') != '') ? $replyTo = $params->get('cronemail_replyto') : $replyTo = $this->app->get('replyto');
($params->get('cronemail_replytoname', '') != '') ? $replyToName = $params->get('cronemail_replytoname') : $replyToName = $this->app->get('replytoname');
$subject = $params->get('subject', 'Fabrik cron job');
$eval = $params->get('cronemail-eval');
$condition = $params->get('cronemail_condition', '');
Expand Down Expand Up @@ -109,8 +111,19 @@ public function process(&$data, &$listModel)
}

$thisSubject = $w->parseMessageForPlaceHolder($subject, $row);
$mail = JFactory::getMailer();
$res = $mail->sendMail($MailFrom, $FromName, $thisTo, $thisSubject, $thisMsg, true);
$res = FabrikWorker::sendMail(
$MailFrom,
$FromName,
$thisTo,
$thisSubject,
$thisMsg,
true,
null,
null,
null,
$replyTo,
$replyToName
);

if (!$res)
{
Expand Down
15 changes: 14 additions & 1 deletion plugins/fabrik_cron/email/forms/fields.xml
Expand Up @@ -14,7 +14,20 @@
description="PLG_CRON_EMAIL_RETURN_PATH_DESC"
label="PLG_CRON_EMAIL_RETURN_PATH_LABEL"
size="30" />


<field name="cronemail_replyto"
type="text"
description="PLG_CRON_EMAIL_REPLYTO_DESC"
label="PLG_CRON_EMAIL_REPLYTO_LABEL"
size="30" />

<field name="cronemail_replytoname"
type="text"
description="PLG_CRON_EMAIL_REPLYTO_NAME_DESC"
label="PLG_CRON_EMAIL_REPLYTO_NAME_LABEL"
size="30" />


<field name="to"
type="text"
description="PLG_CRON_EMAIL_TO_DESC"
Expand Down
Expand Up @@ -27,4 +27,8 @@ PLG_CRON_EMAIL_FROM_LABEL="From name"
PLG_CRON_EMAIL_RETURN_PATH_DESC="Email of the sender. If left blank, the email set in the main Joomla! configuration will be used."
PLG_CRON_EMAIL_RETURN_PATH_LABEL="From"
PLG_CRON_EMAIL_NO_DUPS_DESC="Only send to a specific email address once"
PLG_CRON_EMAIL_NO_DUPS_LABEL="No Duplicates"
PLG_CRON_EMAIL_NO_DUPS_LABEL="No Duplicates"
PLG_CRON_EMAIL_REPLYTO_DESC="Reply To email. if left blank, the reply email set in the main Joomla! config will be used."
PLG_CRON_EMAIL_REPLYTO_LABEL="Reply To"
PLG_CRON_EMAIL_REPLYTO_NAME_DESC="Reply To Name. The name part of the Reply To header. If left blank, the name set in the main Jooml! config will be used."
PLG_CRON_EMAIL_REPLYTO_NAME_LABEL="Reply To Name"

0 comments on commit f2f5bd8

Please sign in to comment.