Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Newsletter to Regular Members

Started by asmith, March 26, 2014, 09:07:08 AM

Previous topic - Next topic



SMF 2.0.7
Trying to use newsletter to only regular members fails.

How to reproduce:
Try sending email or pm to regulars members ONLY. (Admin => newletters)

When in the composing mail page (admin, area=news, sa=mailingcompose)
The hidden input for values contains only 0 value which stands for regular members group:

<input type="hidden" name="groups" value="0" />
After clicking to send:
File: Sources/ManageNews.php, line 493:

// Cleaning groups is simple - although deal with both checkbox and commas.
    if (!empty($_POST['groups']))

empty() will return true because the value is 0, while it should consider that group.

File: Sources/ManageNews.php, line 493:

Replace: (line 493)
    if (!empty($_POST['groups']))
    if (isset($_POST['groups']) && (is_array($_POST['groups']) && !empty($_POST['groups'])) || (!is_array($_POST['groups']) && trim($_POST['groups']) != ''))
First time visiting newsletter page (selecting recipients page), groups is an array. Second time in compose mail, groups is string.