Advertisement:

Author Topic: Newsletters: Users cannot deactivate them  (Read 1726 times)

Offline Kreuvf

  • Semi-Newbie
  • *
  • Posts: 10
Newsletters: Users cannot deactivate them
« 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".

Offline SleePy

  • Let there be light!
  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,603
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: Newsletters: Users cannot deactivate them
« Reply #1 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:
Code: [Select]
if (!empty($condition_array))
$condition = '
AND ' . implode('
AND ', $condition_array);

Replace:
Code: [Select]
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.
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline Kreuvf

  • Semi-Newbie
  • *
  • Posts: 10
Re: Newsletters: Users cannot deactivate them
« Reply #2 on: August 16, 2007, 04:12:21 AM »
Thank you very much.

Offline Kreuvf

  • Semi-Newbie
  • *
  • Posts: 10
Re: Newsletters: Users cannot deactivate them
« Reply #3 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.