Skip Navigation

[Resolved] need a custom field filter option in email notification

This support ticket is created 7 years, 2 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.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

Author
Posts
#487892
Edit CRED Post Form ‹ Babysitters   More — WordPress.png

I am trying to: Send notifications to all users subscribed to a job category on my classified website hidden link.

We've created custom post types by the name "Job" and "Profiles". In the latter, there is a custom CRED field by the name "Category of Work". Please see hidden link.

We wish to send notifications to all users belonging to this category when new content is submitted. Currently, the email notifications can be sent to a specific WordPress user, author, we wish to notify all users belonging to a job category when a new job in submitted in their category.

I can work out PHP if some logic has to be added to the code, just need help in where to look.

I visited this URL:

I expected to see:

Instead, I got:

#487953

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Braydan

You'll need to write some custom code using the CRED API for this.

There is a filter 'cred_mail_header' (https://toolset.com/documentation/user-guides/cred-api/#cred-mail-header) which you can use to modify the headers of a notification email.

So set up a notification email that goes to, say, an admin email address when new content is added.

Then use the filter to trigger a custom query which finds all profiles which have the relevant category, and add them as recipients of the email.

You will only be able to add them to a single email (e.g. as bcc), just one email will be sent. If you wanted each user to be individually sent an email (i.e. to be the sole To: recipient) then you will need to build a custom solution looping over the profiles and using wp_mail() to send each a message.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.