Support » Plugin: Subscribe2 » [Plugin: Subscribe2] Digest Category Subscriptions

  • Is it possible to edit the plugin so that I can have a digest subscription sent out for each category and people can only subscribe to the categories that they want to receive daily digests for? Ideally I would like them to just be able to choose the categories that they want to receive updates for and then receive one email at the end of the day with only the category updates that they are subscribed to, but I know that this would take a great deal of modification so if I can just modify it to have a separate digest email sent for each category (and include it’s sub-categories in that digest) that would be great.

Viewing 5 replies - 1 through 5 (of 5 total)
  • @kfrey12,

    Possible? Yes, almost anything is possible.

    It’s a pretty big edit though. You’d have to enable category selection for users even when Digest is selected, then edit the subscribe2_cron() function to collate the posts, check which categories are included in all the posts made and then cross reference that with your subscriber preferences generating an email per subscriber.

    Since PHP is a script is is usually given a maximum execution time and also restricted RAM that’s why this is not part of the core plugin.


    Thanks for the reply, that is exactly what I thought.

    This was my original plan exactly, but seeing as this could potentially be fairly taxing on the server, my second thought was to just send out an email per category at the end of the day instead of per subscriber. This seems like it would a less intensive edit as well as being less taxing on the server. Do you think this would be a better route to go?


    It would almost certainly be easier to code, you’d only be looking at the subscribe2_cron function in that case and changing the loop to look at categories rather than posts.

    I was just looking at the subscribe2_cron function and noticed at the end when it is preparing the recipients that the following is present:

    $registered = $this->get_registered(“cats=$all_post_cats_string”)

    If I’m reading that correctly, that pulls all of the registered users that are subscribed to category with a new post, so I’m going to loop through only those users and then inside that loop, loop through each of the posts and check the posts categories against that user, and if the user is subscribed to one of the categories in that post I will add that post to the message.

    Does that make sense to you? It seems like it will work exactly how I want it to without as heavy of a load on the server because I’m only checking against users who are subscribed to at least one of the post categories.


    Sort of, that query search for all subscribers who have category subscriptions within the string – which is normally a list. You may been to change the variable to one that is a single category.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Subscribe2] Digest Category Subscriptions’ is closed to new replies.