I can "flush" the system (/admin/user/user/notify) and it sends pending notifications but cron isn't sending the notifications on it's own.

Cron does send other jobs properly...is there anything else that needs to be adjusted?

Comments

tcweb’s picture

I am having the same problem. Any answers yet?

mdowsett’s picture

i think after the flush, it is working. Did you try doing the flush? That almost seemed to activate it.

tcweb’s picture

I did, and it sent the messages in queue, but not any after that. I will try it again.

tcweb’s picture

Still doesn't work :/

tcweb’s picture

Works now...I tried to implement a security certificate and it messed it up. Not sure how I should do that. If you have any suggestions, that would be great. Otherwise...thanks.

mdowsett’s picture

nope - it was a mystery to me too! It's one of those things where yo u are just glad it's working! :)

kriskd’s picture

It appears that notifications are not going out when cron runs, but will when I flush manually. I'm using the latest version of the mod 5.x-1.3. Is this still happening to others?

kriskd’s picture

I dug into the code, figured out why this wasn't working for me and fixed it.

Here's the cron_hook:

function notify_cron() {
  $send_last = variable_get('notify_send_last', 0);
  $send_interval = variable_get('notify_send', 86400);
  $send_hour = variable_get('notify_send_hour', date('G', variable_get('notify_send_last', 0)));
  if ( (time() - $send_last > $send_interval) 
    && (date('G', time()) > $send_hour) 
    && ($send_interval != -1) //special case of settings to send 'never' 
      ) {
    _notify_send();
    variable_set('notify_send_last', time());
  }
}

My problem was with (date('G', time()) > $send_hour). I had cron set to run once a day at 1:00am and my send hour set to 1:00am as well so this condition was never true for me. I adjusted my cron to run a few hours later than what $send_hour is set to and notification e-mails are now going out as expected.

8manj-dupe’s picture

Priority: Normal » Critical

I have tried all the above solutions, still no joy. We have this working perfectly on a development server, but on the live server nothing. I have checked through the server error logs, it seems on the live server it is attempting to send from an apache@ email address, the hosts (Rackspace) have suggested this is possibly to do with the -f flag in the mail() function???

I have tried using 5x1.1 & 5x1.3 versions but neither seem to do the trick.

I have changed the Priority on this issue as this renders the module un-usesable

ajzz’s picture

I just noticed this problem on a production server too. Some accounts had huge backlogs of non-notified content and I had to manually flush as the only way to clear the queue. This needs a fix ASAP!!!

matt2000’s picture

Status: Active » Fixed

This was fixed in the 6.x branch some time ago. I've just committed the same fix to the 5.x branch. Please test the dev version.

Status: Fixed » Closed (fixed)

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