Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/units/helpers/mailing_list_helper.php
Show All 21 Lines | |||||
* Adds new email from given mailing to emails queue | * Adds new email from given mailing to emails queue | ||||
* | * | ||||
* @param string $email | * @param string $email | ||||
* @param int $mailing_id | * @param int $mailing_id | ||||
* @param Array $mailing_data | * @param Array $mailing_data | ||||
*/ | */ | ||||
function queueEmail($email, $mailing_id, &$mailing_data) | function queueEmail($email, $mailing_id, &$mailing_data) | ||||
{ | { | ||||
/** @var kEmailSendingHelper $esender */ | |||||
$esender = $this->Application->recallObject('EmailSender'); | $esender = $this->Application->recallObject('EmailSender'); | ||||
/* @var $esender kEmailSendingHelper */ | |||||
if ($this->_mailingId != $mailing_id) { | if ($this->_mailingId != $mailing_id) { | ||||
if (is_numeric($this->_mailingId)) { | if (is_numeric($this->_mailingId)) { | ||||
// clear fields after previous mailing processing | // clear fields after previous mailing processing | ||||
$esender->Clear(); | $esender->Clear(); | ||||
} | } | ||||
// 1. set headers same for all emails | // 1. set headers same for all emails | ||||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | |||||
* @access protected | * @access protected | ||||
*/ | */ | ||||
protected function _getSenderData(&$mailing_data) | protected function _getSenderData(&$mailing_data) | ||||
{ | { | ||||
$is_root = true; | $is_root = true; | ||||
$email_address = $name = ''; | $email_address = $name = ''; | ||||
if ( $mailing_data['PortalUserId'] > 0 ) { | if ( $mailing_data['PortalUserId'] > 0 ) { | ||||
/** @var UsersItem $sender */ | |||||
$sender = $this->Application->recallObject('u.-item', null, Array ('skip_autoload' => true)); | $sender = $this->Application->recallObject('u.-item', null, Array ('skip_autoload' => true)); | ||||
/* @var $sender UsersItem */ | |||||
$sender->Load($mailing_data['PortalUserId']); | $sender->Load($mailing_data['PortalUserId']); | ||||
$email_address = $sender->GetDBField('Email'); | $email_address = $sender->GetDBField('Email'); | ||||
$name = trim($sender->GetDBField('FirstName') . ' ' . $sender->GetDBField('LastName')); | $name = trim($sender->GetDBField('FirstName') . ' ' . $sender->GetDBField('LastName')); | ||||
$is_root = false; | $is_root = false; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 162 Lines • ▼ Show 20 Line(s) | |||||
/** | /** | ||||
* Sent given messages from email queue | * Sent given messages from email queue | ||||
* | * | ||||
* @param Array $messages | * @param Array $messages | ||||
*/ | */ | ||||
function processQueue(&$messages) | function processQueue(&$messages) | ||||
{ | { | ||||
/** @var kEmailSendingHelper $esender */ | |||||
$esender = $this->Application->recallObject('EmailSender'); | $esender = $this->Application->recallObject('EmailSender'); | ||||
/* @var $esender kEmailSendingHelper */ | |||||
$queue_table = $this->Application->getUnitOption('email-queue', 'TableName'); | $queue_table = $this->Application->getUnitOption('email-queue', 'TableName'); | ||||
$i = 0; | $i = 0; | ||||
$message = Array (); | $message = Array (); | ||||
$mailing_totals = Array (); | $mailing_totals = Array (); | ||||
$message_count = count($messages); | $message_count = count($messages); | ||||
Show All 24 Lines | |||||
$this->Conn->Query($sql); | $this->Conn->Query($sql); | ||||
} | } | ||||
$i++; | $i++; | ||||
} | } | ||||
$this->_updateSentTotals($mailing_totals); | $this->_updateSentTotals($mailing_totals); | ||||
} | } | ||||
} | } | ||||
No newline at end of file | No newline at end of file |