• Resolved woood777

    (@woood777)


    Hello,

    I have the Subscribe2 plugin successfully setup and registered with a custom post type and it’s associated taxonomy.

    I have many registered users with unique subscriptions to specific categories.

    My problem is when a new post is added an email is sent to every user, even if they aren’t subscribed to the category the post is assigned to.

    I would really appreciate some quick help!

    Thanks for a great plugin.

    https://wordpress.org/plugins/subscribe2/

Viewing 15 replies - 1 through 15 (of 26 total)
  • @woood777,

    Can you post the code here that you are using to register the post type and taxonomy in Subscribe2?

    Thread Starter woood777

    (@woood777)

    I was using:

    function my_post_types($types) {
        	$types[] = 'name';
        	return $types;
    }
    
    add_filter('s2_post_types', 'my_post_types');
    
    function my_taxonomy_types($taxonomies) {
    	$taxonomies[] = 'city_town';
    	return $taxonomies;
    }
    add_filter('s2_taxonomies', 'my_taxonomy_types');
    
    I've since switched to the following after reading through the forums:
    
    function my_post_types($types) {
    	$types = array('name');
        	return $types;
    }
    
    add_filter('s2_post_types', 'my_post_types');
    
    function my_taxonomy_types($taxonomies) {
    	$taxonomies = array('city_town');
    	return $taxonomies;
    }
    add_filter('s2_taxonomies', 'my_taxonomy_types');

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    This is a live site and I haven’t tested the new code yet but a new post should be added today that I can then inspect the email logs and see how things are behaving.

    Thanks for your help!

    @woood777,

    The first set of code functions add your custom post type and taxonomy to the defaults (post and page, and categories). The second set remove the defaults and replace them so may work better for you if you don’t want notifications for anything other than your custom post type.

    Thread Starter woood777

    (@woood777)

    We just posted a new post and all users were again sent a notification email. Even if they weren’t subscribed to the taxonomy the post was associated with.

    Do you have any other suggestions?

    @woood777,

    Is your custom post type showing on the Subscribe2->Settings page? If you visit Subscribe2->Your Subscriptions are you seeing only the taxonomy associated with your custom post type?

    Thread Starter woood777

    (@woood777)

    I am seeing the correct taxonomy’s and only those.

    Here’s a screenshot: http://screencast.com/t/5m0etf4pFl6v

    @woood777,

    How are the custom post type and taxonomy being created?

    Thread Starter woood777

    (@woood777)

    They are being created via the CPT UI plugin.

    Thanks for your help

    @woood777,

    I’ve tried to recreate the issue and it works fine for me.

    Perhaps some points to note though:
    1/ When creating the custom post type and taxonomy I created the post type, then the taxonomy assigning the taxonomy to the post type. I then went back into the advanced settings for the post type and assign the taxonomy to the post type.

    2/ When creating the post the taxonomy appears more like a default post tag rather than a default category, so the ‘taxonomy’ must be typed in rather than checking a box. (Although I think if you make it hierarchical then it’ll become a tick box)

    Thread Starter woood777

    (@woood777)

    That makes sense then.

    I’m using ACF’s taxonomy field to assign the post to the taxonomy. Specifically from a drop down list.

    Here is the plugin/documentation: http://www.advancedcustomfields.com/resources/field-types/taxonomy/

    Is there a modification I could apply to get this to work with this field? I very much need it to.

    Thank you again for all your help!

    @woood777,

    I’m not familiar with ACF either really but to me is looks like post meta data and not a true taxonomy in the sense that WordPress would understand.

    I suspect there is a modification that could be made but the source code of the ACF plugin is complex so it would probably be best coming from them.

    Thread Starter woood777

    (@woood777)

    Hi Mattyrob,

    Over the past month I’ve been doing more research into this problem as well as some more testing.

    The Subscribe2 plugin does send emails to the correct subscribers when a taxonomy is assigned using the native WordPress “Tag Cloud” widget. However it sends emails to all subscribers no matter their subscription preferences if the taxonomy is “assigned/saved” any other way.

    For example I followed these instructions and Subscribe2 incorrectly sent emails again to all subscribers: http://shibashake.com/wordpress-theme/wordpress-custom-taxonomy-input-panels

    This is the exact same issue I experience when assigning taxonomies using the ACF plugin.

    I’m guessing that ACF and my previous example use the save_post WordPress hook to save the post to the taxonomy and Subscribe2 isn’t recognizing the taxonomy correctly.

    I’m really hoping there is something that can be done to get this fixed once and for all.

    Thank you again for your help!

    Thread Starter woood777

    (@woood777)

    Also, I’ve contacted ACF and they are not using post meta data and are actually assigning the post to a true taxonomy.

    Thanks again!

    @woood777,

    When you followed the steps here:
    http://shibashake.com/wordpress-theme/wordpress-custom-taxonomy-input-panels

    Did you also update the code above to register the taxonomy in Subscribe2?

Viewing 15 replies - 1 through 15 (of 26 total)
  • The topic ‘Issue – Sending Emails for All Categories’ is closed to new replies.