• Welcome to Simple Machines Community Forum. Please login or sign up.
November 29, 2021, 09:57:19 PM


SMF 2.1 RC4 has been released! Try it out and help us test! :) Read more.

Newsletter to Regular Members

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

Previous topic - Next topic


March 26, 2014, 09:07:08 AM Last Edit: March 26, 2014, 09:36:17 AM by asmith

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.