Here Is a bit of code I have tried. But submit form gives an error.
function wpcf7_do_something (&$WPCF7_ContactForm) {
if ($form->id() == 3851) :
//Not sure How can I get The data of this investment & State Dropdown. Based on
if ($WPCF7_ContactForm->posted_data[‘Investment’] == “15-20 lack” && $WPCF7_ContactForm->posted_data[‘State’] == “Gujarat” ) {
$WPCF7_ContactForm->mail[‘recipient’] = “Name <[email protected]>”;
}
endif;
}
add_action(“wpcf7_mail_components”, “wpcf7_do_something”);
example i want to have 1 contact form that can send to multiple emails. Always 2 emails, one is default that is send whit every form and the other one must be dynamic and change based on the webpage it is on. (example: website that has 100 or more businesses listed on it and each business gets its own page and on each page their is that businesses email address and a contact form (this is 1 default form for every business) now we have to resend all emails manually to each business) which takes up a huge amount of time.
Is it possible to have 1 contact form that somehow sends mail to 1 main email (that mustn’t change) and to the other based on what page it is on.
Website example https://goo.gl/XKNRLA on the page u can see the email is listed and below a contact form but this contact form sends mail to just one main email and then we have to resend to the correct buissness.
Thank you in advance for your help
]]>https://www.ads-software.com/plugins/si-contact-form/
]]>listings
custom post type. Each listing has a custom field where an email can be entered. This is the owner of the listing and where the form will be sent.
I’m using the wpcf7_mail_components
hook to dynamically set the email:
function wpcf7_dynamic_email_field($components) {
/*
Retrieve email using post custom field
*/
// $email = get_field('listing_email', $id );
// $components['recipient'] = $email;
return $components;
}
add_filter('wpcf7_mail_components', 'wpcf7_dynamic_email_field');
… but I’m not sure how to get the $id
of the post the form was submitted from. I tried using get_the_ID()
and global $post; $post->ID
but neither work.
https://www.ads-software.com/plugins/contact-form-7/
]]>I would like to put a contact form below my post content. Is it possible to set the recipient email address in each post differently/ dynamically? My plan is to have articles about different people and I want the visitor to be able to send a mail to that person without revealing his email address. So on each post (that acts like a profile of somebody) is a contact form to be send to this person.
I couldn’t find that in the docs and nothing here in the support section of the plugin page so any help is much appreciated!
https://www.ads-software.com/plugins/contact-form-7/
]]>I want to put the form on my author page. but, then I need to change the email address to the authors one.
How does that work?
Cheers,
Denis
https://www.ads-software.com/extend/plugins/contact-form-7/
]]>