Mails that should be send to all users of a group are not being send. I am not sure if this is a bug or a configuration problem, but I'm guessing the latter.

This was inserted when trying to send a mail to all group users:

sqid  eid   sid   uid   language  type  send_interval   send_method   sent  created   cron  conditions  module  destination
5      84   0     3     NULL      NULL  NULL              debug         0   129970909   1      0     notifications   NULL

I've been trying to find a problem, but was happy to already find out that send_method=NULL was causing the mails to not send.

The variable notifications_send_intervals still has the default value.

This might be the same problem as in #399628 , but since it is added to the table by the notifications module I thought I'd start asking here.

Comments

Yaron Tal’s picture

I meant it looks a lot like issue #399628: emails not being sent to new users because send_interval=NULL, but I was too obsessed with the formatting of the db row. Also that issue didn't get solved, so it didn't give a lot of help.

Yaron Tal’s picture

Category: support » bug

By resubmitting the form on "admin/messaging/notifications" it got better. The newly added rows have a send_interval of 0, so should be send on the next cron run.

The problem seems to be that notifications_user_setting() is called without a default value, thus making the default become NULL.
The piece of code that's causing the problem:

$queue = array(
    'uid' => $uid,
    'sid' => 0,
    'module' => 'notifications',
    'eid' => $event->eid,
    'send_interval' => notifications_user_setting('send_interval', $account), // <-- This line
    'send_method' => notifications_user_setting('send_method', $account),// <-- And this line
    'cron' => 1,
    'created' => time(),
    'conditions' => 0,
  );

I have no time to make a real patch atm, and not even to check if this is also a problem in the latest dev version.
I think notifications_send_intervals() should be used to get a valid default value, or 0 should be used as an easy default.

Yaron Tal’s picture

Status: Active » Needs review
StatusFileSize
new759 bytes

I did find some time to write a patch.
_notifications_subscription_defaults() in the notifications.module file seems to use 0 and '' as the default values, so I used the same values for this function in the notifications_lite module.

Yaron Tal’s picture

Version: 6.x-2.3 » 6.x-2.x-dev

Oh and I made the patch on the 2.x dev version.

grendzy’s picture

Priority: Normal » Major
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new661 bytes

I think this should be "major" because notifications_lite is inoperable in it's default state. I agree this is the right patch. Another version for 6.x-4.x is attached. It doesn't seem to be needed for 7.x since it looks like notifications_lite was removed entirely.

grendzy’s picture

Version: 6.x-2.x-dev » 6.x-4.x-dev
greggles’s picture

Subscribe as an issue I was on was marked as a duplicate.

Thanks!

adam_b’s picture

subscribe

Renee S’s picture

Subscribe. This patch worked for me. Patch has been around since March... can we get it committed?

petednz’s picture

Just trying to get OG Broadcast and Notifications going on a site with OG 6.x-2.1 and Notifications 6.x-2.3 and Messaging 6.x-2.4

Added a new member to an OG and then sent out a Broadcast - the resulting item in the notifications_queue is set to Send Interval = NULL and hence was not received by that new member - while other OG Members got the broadcast.

Then added a new comment to a post on the same OG and the same member received it.

There are no NULL setttings in the Send Interval in the Notifications table itself.

Can anyone hazard a guess as to whether this is same problem as discussed above? Should I try the patch - or wait for M+N 6.x-4.0

Thanks

danepowell’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.