Viewing 3 replies - 1 through 3 (of 3 total)
  • mattyrob

    (@mattyrob)

    @iperez_genius

    This is by design, the more subscribers and categories you have and the more posts that are made leads to exponential increases in the possible combinations of post details in each users email notification. This is not a situation that PHP as a scripting language can handle when hosting providers place strict limitations in server resource usage before timing out the process. This ultimately means failed emails for users and a poor user experience.

    Thread Starter iperez_genius

    (@iperez_genius)

    The long and the short of it is that i must get this to work.

    So this is what i have done, and please let me know where the mistake is because its not working.

    1. Have placed a loop around the entire cron function (subscribe2_cron) to loop through each user.

    2. I have amended the else of “if ( $resend == ‘resend’ ) {” to

    $categories = implode(",", get_user_meta($user->id, $this->get_usermeta_keyname('s2_subscribed'), false));
    
    $sql = "SELECT ID, post_title, post_excerpt, post_content, post_type, post_password, post_date, post_author, wtt.term_taxonomy_id, object_id, wtt.taxonomy, wtt.term_id FROM wp_posts AS a INNER JOIN wp_postmeta AS b ON b.post_id = a.ID AND b.meta_key = '_s2_digest_post_status' AND b.meta_value = 'pending'
    inner JOIN wp_term_relationships as wtr ON
    (a.ID = wtr.object_id)
    inner JOIN wp_term_taxonomy as wtt ON
    (wtr.term_taxonomy_id = wtt.term_taxonomy_id)
    WHERE post_status IN ($status) AND post_type IN ($type)
    AND wtt.taxonomy = 'category'
    AND wtt.term_id in ($categories)
     ORDER BY post_date " . (($this->subscribe2_options['cron_order'] === 'desc') ? 'DESC' : 'ASC');

    The output here is all posts for a given user and the categories. The problem I am currently finding is that the digest email isn’t mailing out.

    Can you provide any guidance?

    I am happy to send you my edited file

    mattyrob

    (@mattyrob)

    @iperez_genius

    Anything in the error logs?

    Is your query actually returning some post data?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Subscribed Category Choices’ is closed to new replies.