contact form 7 send mail according to user response - wordpress

I have set up a Contact Form 7 on my website and It has a drop down so the user can select any option from the drop down . so my problem is this that when a user select from any of the 3 option , a mail has been sent to the user who has submitted a form but I want to sent the mail according to the desired option because I have three different mails for 3 different option
So there is only one option for mailto . Is there any hook to send the mail accoridng to user selection

I'm not 100% sure of what you want, but for what I understand you need to send the email to a different address according to the selected option in the dropdown, right?
The pipes feature allow that.
Your select tag would be something like that:
[select your-recipient "CEO|ceo#example.com"
"Sales|sales#example.com"
"Support|support#example.com"]
With that you'll have the following dropdown in your form:
But in the email the [your-recipient] tag will produce the value after the "|" character. So you can put this tag inside the Mail fields (in your case, it should be in the "To" field, because you want to send the email to that address).
So, if for example an user select "CEO" in the dropdown, the email will be sent to ceo#example.com. And if another user select "Sales", then it will go to sales#example.com.

Related

Contact Form 7 Selectable Recipients with Pipe - Multiple Emails

Per Contact Form 7, this code works for sending to one email addresses for each selection. However, what if I need to send to more than one email address for each selection? What would the proper syntax be for sending to multiple email addresses for each selection? I've tested with a comma between email addresses but that does not seem to work. Any other suggestions?
[select* email-recipient “Sales|sales#yourdomain.com”
“Tech Support|support#yourdomain.com”
“Inquiry|info#yourdomain.com”]
Use Commas for multiple email id, here is the example,
[select* email-recipient "Sales|sales#yourdomain.com" "Tech Support|support#yourdomain.com,test2#yourdomain.com" "Inquiry|info#yourdomain.com,test#yourdomain.com"]
Use multiple select option of contact form7 in order to select multiple emails
[select* email-recipient multiple "Sales|sales#yourdomain.com" "Tech Support|support#yourdomain.com"]

ACF fields ,select where a email goes,apply conditional logic

I have pages with ACF(advanced custom fields) setup with different fields.
I want to be able to access that data and apply a
conditional logic.
To apply the conditional logic there will be a contact form
where the public will fill in and dependant on what they choose
an email will be sent out to different recipients.
Fields are:
Destination: of which there are 5 to choose from
type of place: house, apartment ( drop down)
email address: "email"
Contact form will have
name:
Phone:
email address:
Destination: (acf) select which ones
type of place (acf) selct which ones
Date picker
how many people Adult Children
Accommodation package (select or both)
message
So from the 3 fields... destination, type of place and email
I want an email to go to the email recipients who meet the criteria selected
with all of the mentioned above data to be sent.
with a default email sent to the wp account.
What is the best way to tackle this?
You have here 2 solutions :
First one, the easiest, you create 5 contact form, and depending on the acf value, you print the corresponding contact form. This solution might not been really beautiful, but is working well.
Seconde solution, a little bit harder, would be to add an input hidden in your form. Set the recipient email into this input hidden. Then hook, in your function.php the wpcf7_before_send_mail() hook. During this hook, replace the recipient mail set in CF7 to the one set in input hidden.

Contact Form 7 - press button to validate fieldset

I've used Contact form 7 (wordpress plugin) to create a single form with multiple fieldsets.
The fieldsets are then split (using jquery) like this: http://thecodeplayer.com/walkthrough/jquery-multi-step-form-with-progress-bar
What I want to do is validate all the fields in the fieldset (without submitting the form) - is there a way to
1) validate fields using the validation in contact form 7 manually?
2) specify which fields to validate (based on only those in a fieldset)?
Ideally I want to be able to do it with flexibility in mind as I will be creating 2 or 3 other forms that perform the same way.
Edit: by validate I mean check that the field is:
a) filled in, if it's a required field
b) valid data (so making sure its an email address etc).
My problem is I want to validate the fields manually, without submitting the form, so I can stop them progressing on to the next step of form filling if they've not completed the current fieldset of fields correctly.
Carl
What you want to validate ?
If you want to validate an email address. You should write input type = email in your email textbox.
HTML will validate textbox itself, that it should be in email format.
Same as for digits. If you want to validate that a textbox should contain only number.
Use input type = number on your textbox.
Here is an Example:
https://jsfiddle.net/z9b5mcur/1/

Logic in merge tags, Gravity Forms

I am creating a few Notifications in Gravity Forms and I would like to use some "if/else" logic based on field entries.
For example, I have a Buyer 1 Name field and a checkbox that asks "Would you like to add another buyer?" When they check it, a new Name field appears for Buyer 2. In my Notification I would like to say "The following buyer...." if only the first name is completed, and "The following buyers..." if the 2nd name is filled in. Basically make buyer plural. I could give about 10 more examples of needing logic INSIDE the merge tags, really surprised this isn't available. Thoughts?
You want to use a Gravity Forms conditional shortcode in your notification message. It looks like this:
[gravityforms action="conditional" merge_tag="{Field:1}" condition="is" value="desired value"]Show this content if the field is equal to the field value I specified earlier[/gravityforms]
You can also check out this full tutorial (images included).

Display data from database using selected value from combo list.. (ASP)

Does anyone know how to retrieve and display data from database using combo list? What I mean is this..I have a form..in the form there is a combo list and two textfiels..the user need to choose their company using that combo list..once they have chose their company, the address and contact number of the company will be display in the next two textfields called CAddress and CContact..for example, if the user chose company ABC..how can I display the company ABC address and contact number in those textfields? Need help. Thanks.
first of all you could use javascript and make a call ajax to an asp page passing the id of the company ... in that page you can jsut response.write the infos u need as a xml format ... even csv format would work ... then jsut take the response and write it in the textbox

Resources