Skip Navigation

[Resolved] How to send email notifications to user ids listed in a generic field

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

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by himanshuS 2 years, 8 months ago.

Assisted by: Waqar.

Author
Posts
#2306969

I am using a multi-select generic field to show a list of users to the employer user type.

The employer can only see the user ids of people that applied to their job. I am making this happen using a custom shortcode that shows value and label data.

I would like to send a notification to all the users selected by the employer in the multi-select field. How can I do that?

#2307171

Hi,

Thank you for contacting us and I'd be happy to assist.

You'll need to use a custom function attached to the filter 'cred_notification_recipients':
https://toolset.com/documentation/programmer-reference/cred-api/#cred_notification_recipients

In this custom function, you'll first get the user IDs selected in the generic field, from the global variable $_POST.
( ref: hidden link )

From those user IDs, you'll be able to get their names and emails.
( ref: https://developer.wordpress.org/reference/functions/get_userdata/ )

In the last step, you'll append each user's details in the '$recipients' array, and that email notification will be sent to all those users.

regards,
Waqar

#2309901

My issue is resolved now. Thank you!