Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: Kreuvf on August 10, 2007, 02:37:49 AM

Title: Newsletters: Users cannot deactivate them
Post by: Kreuvf on August 10, 2007, 02:37:49 AM
SMF 1.1.3

Users can specify if they want to receive announcements via e-mail (Profile --> Announcements and E-Mail --> sent e-mail-notification when there is a new announcement). "Announcement" in this case seems to be equal with "newsletter", so I will talk about newsletter from now on.

In the admin-panel I can choose to send all users a newsletter that want this. Additionally there is an option that allows me to ignore the user-setting and send the newsletter to everybody.

But although some users have disabled newsletters and although I have not enabled to ignore the user-setting when writing the newsletter, all e-mail-addresses of all users are added to the "to"-field.

So my question is: What am I doing wrong? Users' e-mail-addresses are supposed to show up only when
a) I have specified to ignore the user-setting (which I didn't do)
b) the user has not disabled newsletters.

Before starting this topic I searched this sub-board for "news letter", "newsletter" and "notify user not".
Title: Re: Newsletters: Users cannot deactivate them
Post by: SleePy on August 15, 2007, 11:13:28 PM
This is a bug in 1.1.3

You can fix it by opening ManageNews.php (Sources)

And Find:
if (!empty($condition_array))
$condition = '
AND ' . implode('
AND ', $condition_array);


Replace:
if (!empty($condition_array))
$condition .= '
AND ' . implode('
AND ', $condition_array);


It is a 1 character change but it causes this problem. You will need to reverse this change to upgrade to 1.1.4 when it is released.
Title: Re: Newsletters: Users cannot deactivate them
Post by: Kreuvf on August 16, 2007, 04:12:21 AM
Thank you very much.
Title: Re: Newsletters: Users cannot deactivate them
Post by: Kreuvf on August 17, 2007, 04:00:20 AM
I attached the fix as a mod-file so people don't need to manually edit files.

If there are any problems with the mod-file, tell me.