Support » Plugin: Subscribe2 » Custom post type not mailing

  • Resolved cw17s0n


    My regular posts show up in the digest email, my cpt does not. Any ideas? In my functions.php I have added the following:

    function my_post_types($types) {
        $types[] = 'super_user_update';
        return $types;
    add_filter('s2_post_types', 'my_post_types');

    and my cpt

    function register_cpt_super_user_update() {
        $labels = array(
            'name' => _x( 'Super User Updates', 'super_user_update' ),
            'singular_name' => _x( 'Super User Update', 'super_user_update' ),
            'add_new' => _x( 'Add New', 'super_user_update' ),
            'add_new_item' => _x( 'Add New Super User Update', 'super_user_update' ),
            'edit_item' => _x( 'Edit Super User Update', 'super_user_update' ),
            'new_item' => _x( 'New Super User Update', 'super_user_update' ),
            'view_item' => _x( 'View Super User Update', 'super_user_update' ),
            'search_items' => _x( 'Search Super User Updates', 'super_user_update' ),
            'not_found' => _x( 'No super user updates found', 'super_user_update' ),
            'not_found_in_trash' => _x( 'No super user updates found in Trash', 'super_user_update' ),
            'parent_item_colon' => _x( 'Parent Super User Update:', 'super_user_update' ),
            'menu_name' => _x( 'Super User Updates', 'super_user_update' ),
        $args = array(
            'labels' => $labels,
            'hierarchical' => false,
            'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'page-attributes' ),
            'taxonomies' => array( 'tminus', 'deployments', 'super_user_tags', 'category' ),
            'public' => true,
            'show_ui' => true,
            'show_in_menu' => true,
            'menu_position' => 5,
            'show_in_nav_menus' => false,
            'publicly_queryable' => true,
            'exclude_from_search' => false,
            'has_archive' => true,
            'query_var' => true,
            'can_export' => true,
            'rewrite' => true,
            'capability_type' => 'post'
        register_post_type( 'super_user_update', $args );

Viewing 7 replies - 1 through 7 (of 7 total)
  • @cw17s0n,

    I suspect you may need to resister some custom taxonomies as well as registering the custom post type. The code for doing this is very similar to the registration of custom post types and is covered in the FAQs.

    I registered all of my custom taxonomies with no change, I did happen upon something, if I create a new post(standard) and a new post(custom), and trigger a digest email with crontrol, I get an email only showing the standard post, if I hit “resend digest” within subscribe2 I get the email with both posts.


    Manually triggering digests can sometimes have unexpected consequences as it changes the database time settings for when previous events were sent. Let the next scheduled event run as planned and then make some new entries and I think based on what you are saying it should now work.

    I set it to hourly triggers, it has run three times now, each time it ran I create new posts, each time I get just the standard wordpress posts but not the cust. posts. Any further ideas?


    Does it still work for a resend? If so that’s very strange as the resend code runs exactly the same Subscribe2 function but just calls an SQL query with different time parameters.

    That is correct, it works as expected for the resend.


    Here’s how the time frames work in the code. Image 3 time points – now, ‘x’ in the past and ‘2x’ in the past.

    The cron fired digest gets called by wp-cron and collects all posts made between time now and ‘x’. If you manually hit resend it simply collects the posts made between ‘x’ and ‘2x’.

    The only thing I can image it might be is something to do with the times on your server. Try reseting to per-post and revery back to hourly again. You could also try the development version of the code.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Custom post type not mailing’ is closed to new replies.