@alysiacaringi
Only Registered users can control their subscription at category level, presuming that your code is correct and the post type and taxonomy are correctly registered in Subscribe2.
Thanks for your quick response.
Ok, so it is possible? I think I have it set up correctly. The only thing is that I’m subscribing registered users to specific categories…instead of having them subscribe themselves.
For some reason I’m still getting emails from all categories instead of only the ones I subscribed to.
@alysiacaringi
Can you post the code you’ve used here so we can check it?
Hi,
I ran a few tests and it looks like I’m the only one getting emails for every category. Everyone else works the way it’s supposed to. I must have some setting wrong somewhere.
Thanks for your help!
Just marking this as resolved.
Ugh, OK just kidding…this isn’t resolved. Just got an email I shouldn’t have. Here’s the code I’m using.
function my_post_types($types) {
$types[] = 'find-expert';
return $types;
}
add_filter('s2_post_types', 'my_post_types');
function my_taxonomy_types($taxonomies) {
$taxonomies[] = 'categoryexpert';
return $taxonomies;
}
add_filter('s2_taxonomies', 'my_taxonomy_types');
@alysiacaringi
Okay, there is nothing at all wrong with your code.
Have you set the number of recipients per email to anything other than 1 in the Subscribe2 settings?
Nope, the number of recipients is set to 1.
@alysiacaringi
Have you installed an email logging plugin to see what emails are being generated. I am wondering / hoping this is just affecting you.
I haven’t. I’ll do that and let you know.
I did however try this with several different emails (all owned by me but with newly created WordPress accounts) and experienced the same issue.
@alysiacaringi
Have you got any Excluded or Compulsory categories?
Are you assigning posts to more than 1 category at a time?
Have you disabled all other plugins to ensure there isn’t some sort of conflict going on?
No categories are compulsory and all categories are excluded. I excluded them all and then subscribe the (registered) user to their preferred category manually.
Posts only have one category.
I disabled all plugins except for the plugins I use to generate the custom post which are CRED and Types. Perhaps Subscribe2 doesn’t work with categories created by the Types plugin?
The email logging plugin showed that other users were getting notifications for the wrong category as well.
@alysiacaringi
One thing that’s just occurred to me, I think I’ve seen this before when the custom post type and custom taxonomy were not associated with each other. Do the plugins you’ve used to create the post type and taxonomy allow them to be associated with each other?
Yep, the post type and taxonomy type are associated with each other.
@alysiacaringi
At this point I’m running out of suggestions. The best I can suggest at the moment is using a different plugin to create the custom post type and taxonomy, one that I have seen before and that I know works:
https://wordpress.org/plugins/custom-post-type-ui/