mirror of
https://github.com/e107inc/e107.git
synced 2025-03-14 01:19:44 +01:00
New 'sent' method added to e_mailout. Triggered during email queue processing.
This commit is contained in:
parent
20d8aec3ba
commit
d4d55ac057
@ -712,6 +712,29 @@ class e107MailManager
|
||||
|
||||
// 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
|
||||
|
||||
// Now update email status in DB. We just create new arrays of changed data
|
||||
|
@ -237,6 +237,23 @@ class newsletter_mailout
|
||||
{
|
||||
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');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user