[Resolved] Allow user subscribe with specific value of custom field.
This support ticket is created 3 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
Can you help me to approach this? There is a custom type typeA, a custom field fieldA. The website allows anyone to register. Anyone can subscribe to typeA. If there are 2 conditions meet, it will trigger automatically send an email to the user.
1. A new post of typyA published.
2. The value of fieldA equals to a specific value(for example the value of a textbox is "Yes")
If it is not the case, please explain your use case with as many details as possible in a way like:
1. I go to xxx
2. I do xxx
3. I expect to have xxx
4. Instead, I get xxx
1. There is a custom type typeA, a custom field fieldA.
2. The website allows anyone to register. Anyn registered member can submit post of typeA.
3. In user form there are option of for subscribe email with specific value of filedA. for example:
tickbox 1 []fieldA = "Rice"
tickbox 2 []fieldA = "Noodle"
tickbox 3 []fieldA = "Pancake"
When user tick any of above checkboxes in user profile and there is a new post of typeA is published. he will get a notification email.
For example, if he tick "Rice", when there is a new typeA with the fieldA value = "Rice", he will get a notification email. If the new typeA with the fieldA value = "Noodle", he won't get email.
4. the above rule applies to all registered member.
Thank you! Now I understand better what you want to achieve. You want users to subscribe to some topics(Rice, Noodle, Pancake), then you want them to get a notification email when a new post is published on the same topics.
This will need custom code to be implemented. You will need to build a function that will return all the users that are subscribed to a topic. Check this article, it has an example of searching for users by a user custom field https://developer.wordpress.org/reference/classes/wp_user_query/
Then you can add the emails of these users to the notification hooked function.