Skip to content

Commit

Permalink
A few fixes for refactored list email plugin, and switched to using o…
Browse files Browse the repository at this point in the history
…ur sendMail helper.
  • Loading branch information
cheesegrits committed Jun 1, 2016
1 parent 37c0e49 commit 288ef02
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
16 changes: 9 additions & 7 deletions plugins/fabrik_list/email/models/email.php
Original file line number Diff line number Diff line change
Expand Up @@ -665,9 +665,7 @@ private function _send($row, $mailTo)
list($replyEmail, $replyEmailName) = $this->_replyEmailName($row);
$thisSubject = $w->parseMessageForPlaceholder($subject, $row);

$mail = JFactory::getMailer();

return $mail->sendMail($emailFrom, $fromName, $mailTo, $thisSubject, $thisMsg, 1, $cc, $bcc, $this->filepath,
return FabrikWorker::sendMail($emailFrom, $fromName, $mailTo, $thisSubject, $thisMsg, 1, $cc, $bcc, $this->filepath,
$replyEmail, $replyEmailName);
}
}
Expand Down Expand Up @@ -744,6 +742,12 @@ public function addressBook()
{
$params = $this->getParams();
$table = $params->get('emailtable_to_table_table');

if (empty($table))
{
return array();
}

$tableEmail = $params->get('emailtable_to_table_email');
$tableName = $params->get('emailtable_to_table_name');

Expand Down Expand Up @@ -917,8 +921,7 @@ private function mailMerged($firstRow, $mergedMsg, $sent, $notSent)

if ($sent > 0)
{
$mail = JFactory::getMailer();
$res = $mail->sendMail($emailFrom, $fromName, $thisTos, $thisSubject, $mergedMsg, true, $cc, $bcc, $this->filepath,
$res = FabrikWorker::sendMail($emailFrom, $fromName, $thisTos, $thisSubject, $mergedMsg, true, $cc, $bcc, $this->filepath,
$replyEmail, $replyEmailName);
}
}
Expand All @@ -928,8 +931,7 @@ private function mailMerged($firstRow, $mergedMsg, $sent, $notSent)
{
if (FabrikWorker::isEmail($thisTo))
{
$mail = JFactory::getMailer();
$res = $mail->sendMail($emailFrom, $fromName, $thisTo, $thisSubject, $mergedMsg, true, $cc, $bcc, $this->filepath,
$res = FabrikWorker::sendMail($emailFrom, $fromName, $thisTo, $thisSubject, $mergedMsg, true, $cc, $bcc, $this->filepath,
$replyEmail, $replyEmailName);

if ($res)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<?php
if ($this->toType == 'field')
{
$to = $this->_emailTo();
$to = $this->emailTo;
?>
<div class="span12">
<?php
Expand Down
2 changes: 1 addition & 1 deletion plugins/fabrik_list/email/views/popupwin/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function display($tmpl = 'default')
$this->allowAttachment = $model->getAllowAttachment();
$this->editor = $model->getEditor();
$this->toType = $model->_toType();
$this->emailtTo = $model->_emailTo();
$this->emailTo = $model->_emailTo();
$this->params = $model->getParams();
$this->listEmailTo = $model->formModel->getElementList('list_email_to');
$this->addressBook = $model->addressBook();
Expand Down
2 changes: 1 addition & 1 deletion plugins/fabrik_list/email/views/popupwin/view.partial.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function display($tmpl = 'default')
$this->allowAttachment = $model->getAllowAttachment();
$this->editor = $model->getEditor();
$this->toType = $model->_toType();
$this->emailtTo = $model->_emailTo();
$this->emailTo = $model->_emailTo();
$this->params = $model->getParams();
$this->listEmailTo = $model->formModel->getElementList('list_email_to');
$this->addressBook = $model->addressBook();
Expand Down

0 comments on commit 288ef02

Please sign in to comment.