Skip Navigation

[Resolved] Dynamic Notifications in CRED

This support ticket is created 8 years, 1 month 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)

This topic contains 3 replies, has 3 voices.

Last updated by miguelB-4 8 years, 1 month ago.

Assisted by: Nigel.

Author
Posts
#425652

I am trying to:
Create a CRED Form that will send emails to different recipients based on options selected from a given query generated by VIEWS
For example: the users are presented with all the vendors in a given category. All the vendors will have a checkbox, and depending on which checkbox are selected, CRED will send a custom notification email to all selected vendors.

Any Ideas of how can I implement this?

#425727

There are 2 Problems.

1. How you create the List (Checkoboxes) of teh emails you wish the user to be able to choose?

Views can not be used for that.
If you plan to do it with Views, you will need to generate a JSON valid code, and that is only possible if you Filter with PHP Code your Views output.

2. Assuming you somehow (maybe even with a external JSON File) populate a Generic Checkboxes Field, you can then set the CRED Notifications to be sent (each one of them) to a recipient set in the Custom Field (your-field)

Problematic here is, that this is easy id you have ONE email set in the Field.
If you now have a ARRAY; which Checkboxes are, you will have to use Custom Code to foreach into that array and get out each single value, and pass it to CRED as single Emails.

As the relevant setting in CRED says, "Send notification to AN email specified in A form field:"

It's inteded to be one email each notification setting of this kind.

I would suggest you also have a look at this API:
https://toolset.com/documentation/user-guides/cred-api/#cred-mail-header

With that you could extend the header of your notification using the "to" header:
hidden link

This would allow you to get a series of Emails from the given Checkboxes Fields and populate the "to" of the notification with all those, therefore sending to all recipients.

It all involves additional Application Logic, which Toolset does provide the API for, but the Code for it shoudl be written manually.

#425758

Nigel
Supporter

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

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

Beda beat me to the punch.

I was drafting a reply that was essentially the same, but I was going to link to this old thread which you may find useful that shows using a View to dynamically populate the options of a generic field on a CRED form. You will need something different but you should get the idea hopefully.

https://toolset.com/forums/topic/dynamic-cred-generic-field-options/

#431882

I need to research on your answers. Thank you

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