AndyB
Well-known member
Automated Bounced Email Handler for guests:
If you will offer guests the ability to subscribe to your Email Subscription and you have configured "Automated Bounced Email Handler" in XenForo, you can automatically eliminate those invalid email addresses from the Email Subscription by adding the following code.
Adds ability to automatically remove guest email subscriptions from add-on Email Subscription if email bounces.
XenForo/Model/EmailBounce.php
Line 15
If you will offer guests the ability to subscribe to your Email Subscription and you have configured "Automated Bounced Email Handler" in XenForo, you can automatically eliminate those invalid email addresses from the Email Subscription by adding the following code.
Adds ability to automatically remove guest email subscriptions from add-on Email Subscription if email bounces.
XenForo/Model/EmailBounce.php
Line 15
PHP:
$recipient = $bounce->getRecipient();
if ($recipient)
{
$userId = $this->_getDb()->fetchOne('SELECT user_id FROM xf_user WHERE email = ?', $recipient);
if (!$userId)
{
//########################################
// start hack
//########################################
// get database
$db = XenForo_Application::get('db');
// delete row if older than 30 days
$db->query("
DELETE FROM xf_email_subscription
WHERE email = ?
",$recipient);
//########################################
// end hack
//########################################
$userId = null;
}
}
Last edited: