Sort Digest?
SomebodySysop - April 8, 2009 - 19:20
| Project: | Subscriptions |
| Version: | 6.x-1.0-beta5 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Would it be possible to sort the digests by content type? That is, generate the digest so that all the content of a particular type is grouped together?

#1
There's currently no option to do that, but it could be implemented. Right now, it's strictly in time order, which is the one order that pretty much everyone can immediately relate to...
How would by-content-type be an improvement?
#2
A user made the request. They have 3 content types: Feeds, Stories and Events. It would be more readable and useful (according to him) if the digests were sorted by the content types so that the user could focus on the most important section(s) first. Of course, they're getting lots of these daily, so that's why I think it sort of makes sense.
If I were to attempt some sort of patch, where would you recommend that I look first?
#3
Sorry for the long delay...
In subscriptions_mail_cron() look for
foreach ($mails as $uid => $user_mails)$user_mails is an array of the notifications for this one $uid. Sort them as you like.
However, I'm afraid you don't have the content type that you want to sort by. So look above, where the $mails array is filled, and add the content type to each mail.
#4
It might make sense to implement a hook here, so that a custom module could provide sorting. Care to submit a patch?
#5
Thanks for the follow-up. I'll take a look.