Closed (fixed)
Project:
Activity Log Email Digests
Version:
6.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
25 Aug 2011 at 17:57 UTC
Updated:
16 Jan 2012 at 22:10 UTC
Jump to comment: Most recent file
Comments
Comment #1
ezra-g commentedHow should this work?
One idea:
- Enter a UID (or omma-separated list of UIDs) to send digests to
- Submit the form
- Report how many messages were sent to the user (including 0 if there were no messages sent to the user)
- Don't do
db_query("UPDATE {digests} SET last_sent = %d WHERE uid = %d", $now, $account->uid);This would probably call for some refactoring of the _digests_cron() function so that we can re-use code.
Comment #2
icecreamyou commentedPatch attached. Requires rebuilding the menu cache.
The new "send now" functionality is located at
admin/settings/digests/send. It behaves a little differently than what happens during cron -- most importantly it includes activity that occurred within the last day, it doesn't record in the database that a digest email was sent, and it will send email to anyone who has recent activity in their stream regardless of whether it's time for them to get a digest email or not. I split _digests_cron() into 6 different functions.I've tested this patch and it seems to work for me (although I haven't tested whether it messes up sending emails during cron). If someone else can confirm that it doesn't mess up sending emails during cron, I'll commit it.
(Note that as of this writing, if you're testing with the latest dev of activity_log, tokens in digest activity templates will appear not to evaluate -- that's because digests hasn't been updated to support the recent translation patch.)
Comment #3
icecreamyou commentedCommitted this to dev. Though the diff looks big, if you have a visual diff tool you can see that really the only difference in the business logic is moving chunks of _digests_cron() to different functions. I'm reasonably confident that this won't break anything that wasn't already broken.
Comment #5
wickedwookie commentedCurrently the instructions at admin/settings/digests/send read
This might need to be changed. According the source code, only events between yesterday 6pm and 24 before that are included... I ran in circles for almost a couple of hours because of that ;)
As this function is mostly used for testing rules/templates etc, why not add an option to choose the number of days (now (-24h * #days)) to include in that "send now digest"?
Comment #6
icecreamyou commentedThe timing settings are pretty hardcoded and the queries are already complex as it is. Do you have a suggestion for how to change the instructions to make it clearer what's going on?