mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 13:47:31 +02:00
New 'sent' method added to e_mailout. Triggered during email queue processing.
This commit is contained in:
@@ -712,6 +712,29 @@ class e107MailManager
|
|||||||
|
|
||||||
// return; // ************************************************** Temporarily stop DB being updated when line active *****************************
|
// return; // ************************************************** Temporarily stop DB being updated when line active *****************************
|
||||||
|
|
||||||
|
$addons = array_keys($email['mail_selectors']); // trigger e_mailout.php addons. 'sent' method.
|
||||||
|
|
||||||
|
foreach($addons as $plug)
|
||||||
|
{
|
||||||
|
if($plug === 'core')
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($cls = e107::getAddon($plug,'e_mailout'))
|
||||||
|
{
|
||||||
|
$email['status'] = $result;
|
||||||
|
|
||||||
|
if(e107::callMethod($cls, 'sent', $email) === false)
|
||||||
|
{
|
||||||
|
e107::getAdminLog()->add($plug.' sent process failed', $email, E_LOG_FATAL, 'SENT');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// --------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$this->checkDB(2); // Make sure DB object created
|
$this->checkDB(2); // Make sure DB object created
|
||||||
|
|
||||||
// Now update email status in DB. We just create new arrays of changed data
|
// Now update email status in DB. We just create new arrays of changed data
|
||||||
|
@@ -238,6 +238,23 @@ class newsletter_mailout
|
|||||||
e107::getLog()->add('Newsletter Bounce', $data, E_LOG_INFORMATIVE, 'BOUNCE');
|
e107::getLog()->add('Newsletter Bounce', $data, E_LOG_INFORMATIVE, 'BOUNCE');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Manage Sent.
|
||||||
|
*/
|
||||||
|
public function sent($data) // trigerred when email sent from queue.
|
||||||
|
{
|
||||||
|
if($data['status'] == 1) // Successfully sent
|
||||||
|
{
|
||||||
|
// e107::getLog()->add('Newsletter Sent', $data, E_LOG_INFORMATIVE, 'SENT');
|
||||||
|
}
|
||||||
|
else // Failed
|
||||||
|
{
|
||||||
|
// e107::getLog()->add('Newsletter Sent', $data, E_LOG_FATAL, 'SENT');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user