• I have a custom post type of “monthly bulletin” that I need to send to subscribers.
    I’ve added the code below into my functions.php file, and tested it by publishing a new bulletin, but the email notification doesn’t come through.

    Any ideas on what I am missing?

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

    I’ve tested the plugin with a standard post and that works fine.

    Thanks in advance.

    https://www.ads-software.com/plugins/subscribe2/

Viewing 4 replies - 31 through 34 (of 34 total)
  • @physalis

    Adding hooks to plugins is easy, Subscribe2 is full of them! A simple hook in the Q&E plugin could solve your issue while maintaining functionality for others.

    @mattyrob I wouldn’t believe they cater in much hooks, they are a bit slow on response and working, but thank you for your continued support, even though it didn’t work out successfully :).

    Hi all,
    I assume not to create a new thread and write my question here…
    So I registered 3 custom post types in my functions.php file for Subscribe2 by this way:

    // Custom post types Subscribe2
    function my_post_types1($types) {
        $types[] = 'projects';
        return $types;
    }
    
    function my_post_types2($types) {
        $types[] = 'publications';
        return $types;
    }
    
    function my_post_types3($types) {
        $types[] = 'news';
        return $types;
    }
    
    add_filter('s2_post_types', 'my_post_types1');
    add_filter('s2_post_types', 'my_post_types2');
    add_filter('s2_post_types', 'my_post_types3');

    But there are some troubles:
    1. When user subscribes to updates he doesn’t choose via checkboxes what post type he need and finally he gets email notifications from all the custom post types I registered above.
    2. User doesn’t get a message about what post type he has subscribed and I have no idea how to paste the title into the body mail.

    I read faq and api pages but still can’t get how to solve these issues.

    @cherry07

    Your code looks good but could be summarised to this:
    `function my_post_types($types) {
    $types[] = ‘projects’;
    $types[] = ‘publications’;
    $types[] = ‘news’;
    return $types;
    }

    add_filter(‘s2_post_types’, ‘my_post_types’);\

    Also, Subscribe2 allows subscriptions based on categories, not post type. So, are you using the same taxonomy (categories and tags) for your custom post types as for core posts or is there a new taxonomy?

    If you are using a new taxonomy that needs registering in Subscribe2 as well as the post type using the ‘s2_taxonomies’ filter hook.

Viewing 4 replies - 31 through 34 (of 34 total)
  • The topic ‘Using with Custom Post Type’ is closed to new replies.