Skip to content

Commit

Permalink
Switch to Fabrik helper sendMail for juser plugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
cheesegrits committed May 3, 2018
1 parent 03da3e5 commit 8f259e9
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions plugins/fabrik_form/juser/juser.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,6 @@ public function onBeforeStore()
return;
}

$mail = JFactory::getMailer();
$mail->isHtml(true);

// Load up com_users lang - used in email text
$this->lang->load('com_users', JPATH_SITE);
/*
Expand Down Expand Up @@ -677,8 +674,14 @@ public function onBeforeStore()
// Send the registration email.
if ($emailSubject !== '')
{
$return = $mail->sendMail($data['mailfrom'], $data['fromname'], $data['email'], $emailSubject, $emailBody);

$return = FabrikWorker::sendMail(
$data['mailfrom'],
$data['fromname'],
$data['email'],
$emailSubject,
$emailBody,
true
);
/*
* Added email to admin code, but haven't had a chance to test it yet.
*/
Expand Down Expand Up @@ -878,7 +881,12 @@ protected function emailToAdmin($data)
// Send mail to all superadministrators id
foreach ($rows as $row)
{
$return = JFactory::getMailer()->sendMail($data['mailfrom'], $data['fromname'], $row->email, $emailSubject, $emailBodyAdmin);
$return = FabrikWorker::sendMail(
$data['mailfrom'],
$data['fromname'],
$row->email, $emailSubject,
$emailBodyAdmin
);

// Check for an error.
if ($return !== true)
Expand Down

0 comments on commit 8f259e9

Please sign in to comment.