Tell us what you are trying to do?
I'm trying to create a contact form that has an option to add your address then it shows your 3 closest offices from which you can select your preferred location. Then send the form to that office's email address.
So the form would have the simple fields
name
email
phone
Prefered date ( basic calendar selector )
What type of client are you (checkbox selector to show personal or business)
Services required based on type of client ( checkbox selection of services, this section hidden options based on selections )
Find your local office / Enter your suburb, region or postcode (as you type I'd like to show the options available to the client and they select the office they prefer. This can be an auto filling field using Relevanssi I guess or show results and you click to select... This part is where I'm unsure if its possible )
SUBMIT - Sends the form to the office selected above
Is there any documentation that you are following?
I've only been watching the video tutorials available on youtube and via the backend and can't work out if this is possible with the base plugins and some configuration or if it will need some custom code to achieve the desired result
Is there a similar example that we can see?
To be 100% honest I've not found an exact example of the form I'm trying to achieve. If we could see a list of the local offices based on the address then as it auto fills the
What is the link to your site?
That is the current domain I'm working on but it's not the final location for this solution. I just wanted to work offline prior to doing it on the actual site that is much larger
versteckter Link
Initially, I'd just like to know if this is possible without a developers support or if I'll need some custom code.
Hope that make sense and thanks for your time
Hello,
There isn't such a built-in feature within Toolset plugins, and you are right, it needs custom code works, here is my suggestion.
When user submit the CRED form, use CRED filter hook "cred_notification_recipients" to trigger a PHP function, in this function:
1) get the address field value submitted by user
2) find those three office posts, get the email address from those office posts
3) change the notification recipients to above email address values
More help:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_notification_recipients
This filter allows you to add or modify email recipients of CRED notifications