I noticed an issue when attempting to send a newsletter and the plugin encounters a null email caused by the social plugin email registering a user but not adding their email address,
i believe i have a solution, although i have to test it further,
in file pluginNewsletters.class.php, replace the getRecipients function with this one.
public function getRecipients($userGroup, $includeUnsubs = false)
{
// setup database
$db = Database::getDatabase();
$clause = '';
switch($userGroup)
{
case 'free only':
$clause = 'level_id = 1 && email != ""';
break;
case 'premium only':
$clause = 'level_id = 2 && email != ""';
break;
case 'moderator only':
$clause = 'level_id = 10 && email != ""';
break;
case 'admin only':
$clause = 'level_id = 20 && email != ""';
break;
default:
// all registered
$clause = '1=1';
break;
}
$sQL = 'SELECT * FROM users WHERE '.$clause;
if($includeUnsubs == false)
{
$sQL .= ' AND id NOT IN (SELECT user_id FROM plugin_newsletter_unsubscribe)';
}
return $db->getRows($sQL);
}
i believe i have a solution, although i have to test it further,
in file pluginNewsletters.class.php, replace the getRecipients function with this one.
public function getRecipients($userGroup, $includeUnsubs = false)
{
// setup database
$db = Database::getDatabase();
$clause = '';
switch($userGroup)
{
case 'free only':
$clause = 'level_id = 1 && email != ""';
break;
case 'premium only':
$clause = 'level_id = 2 && email != ""';
break;
case 'moderator only':
$clause = 'level_id = 10 && email != ""';
break;
case 'admin only':
$clause = 'level_id = 20 && email != ""';
break;
default:
// all registered
$clause = '1=1';
break;
}
$sQL = 'SELECT * FROM users WHERE '.$clause;
if($includeUnsubs == false)
{
$sQL .= ' AND id NOT IN (SELECT user_id FROM plugin_newsletter_unsubscribe)';
}
return $db->getRows($sQL);
}