Hi, I need to send a Toolset Form notification to multiple WP users.
Is it possible to pass a list of IDs separated by comma by a Generic field if I select "Send notification to a WordPress user with an ID coming from a generic field in the form"?
Or, is there another option to send the notification to multiple WP users?
Thank you for contacting us and I'd be happy to assist.
By default, the "Send notification to a WordPress user with an ID coming from a generic field in the form" option can be used to send email to only a single WordPress user.
The above code can be added into the active theme's "functions.php" file and please replace "admin notification name" with the actual name of your notification and '12345' with the actual ID of your form.
Next, in your notification, you can create a hidden generic field with field slug "user_ids" and then select that field in the "Notification e-mail recipients" settings.
I hope this helps and please let me know if you need any further assistance around this.
Note: For more personalized assistance around custom code, you can also consider hiring a professional from our list of recommended contractors: https://toolset.com/contractors/
Waqar has a couple of days holiday, so let me jump in here.
I'm guessing that there needs to be at least one "to" even if the rest are all "bcc" (because according to the documentation what you've done should work).
Does $recipients already contain a "to" entry?
You could update the notification settings to also send the email to a specific email address so that there is at least one "to".
I've just to set an email on " Send notification to a specific email address: " field (I used a not existing email like wordpress@my-domain.com) and now it works fine.
I've also set "Send notification to a WordPress user with an ID coming from a generic field in the form:" to bcc and changed the custom code to 'to' => 'bcc'.