Hi,
I have been using the earlier 'subscriptions' and recently upgraded to 5.x-2.0.
The model works fine except for the fact that the mails are sent at cron runs no matter what 'user defaults' I set as an admin. Individual users' send interval preferences also have no effect.
To elaborate, my cron runs every 15 mins but even if I set user notification frequency as 1 hour, the subscription notifications are still sent every 15 minutes.
Some details on my set up:
I have upgraded from 5.x-1.0 version.
I have successfully set up the module along with subscriptions-mail and job_queue modules.
I am also using Organic Groups on my site.
I see no other functional issues with subscriptions apart from this.
Any solutions? Am I doing something wrong? I did not delete the old module's tables for the fear of losing current subscriptions of all users.
A bit of a noob here so any help will be appreciated.
Comments
Comment #1
salvisAre you sure about this? The way it's supposed to work is that the first batch of notifications will be sent at the very next cron run, but the same user should not receive another batch within the same 60 minutes from when the last batch was sent. Other users may run on different quarters, of course.
Testing this requires a bit of careful planning...
Comment #2
shas3n commentedI am sure it sends notifications at every cron run irrespective of user preference.
I have a normal user account apart from the admin account and I have set my update frequency as 1 hour in 'My account -> Subscriptions -> settings'. I still receive a notification every 15 minutes.
This is the case even with 'digest' mode. The notifications are bundled alright, but the digest is sent every 15 mins.
I guess if it is only me facing the problem, it might be due to other modules that I have installed. But I am unable to see anything that would interfere with this.
Is there a way I can check manually in the database where the send frequencies are stored and make sure they are OK?
I am not a programmer so be a bit easy on technical instructions :)
Thanks!
Comment #3
salvisYes, I'd be very interested to get that information. Unfortunately, timestamps are just large numbers in the database (seconds since an arbitrary point in time in the last century), so they're a bit difficult to decypher, but here's what should be happening:
Whenever a notification is sent to a user, this is executed:
It sets last_sent for that user to the current time in the {subscriptions_user} table.
When notifications are queued, this query
takes the user's last_sent and puts it (along with the send_interval of that subscription item) into the record of the pending notification in {subscriptions_queue}.
Finally, those records are retrieved with
Here, last_sent+send_interval is the earliest time at which that user would want to receive another notification from that subscription item (the send_interval can be different for every subscription item), and the pending notification record is only retrieved (and subsequently processed and deleted), when the current time is past last_sent+send_interval.
This should work, and I'd like to know why you get the impression that it doesn't.
Comment #4
shas3n commentedJust discovered that there is nothing in the job queue (at /admin/logs/job_queue) when something is posted. I presume this results in the posts not being held long enough to skip the cron run.
Is there any particular configuration needed apart from enabling the job_queue module?
Moreover, the settings page for job queue (at admin/settings/job_queue) does not show anything other than an empty table and a save button.
Is this normal?
Thanks for trying to help me and I appreciate your patience with this.
Comment #5
salvisSubscriptions doesn't use job_queue at all. What gave you that idea?
Comment #6
shas3n commentedI found out that the notifications by subscriptions_og module were over riding the frequency of mailing as set by subscriptions module.
Now by changing the settings for sybscriptions_og to send notifications less frequently than subscriptions module, the problem is solved. (Marking the issue as fixed now).
Thanks for your help and thank you very much for a useful module.
Comment #7
salvisThanks for wrapping up.
You mean subscriptions_og isn't using the send_interval defaults that you set in subscriptions?
Please report that as a bug in the subscriptions_og issue queue.
Comment #8
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.