contact-form-7

How do I check if email submitted via Contact form 7 exists in my database?

做~自己de王妃 提交于 2019-12-04 17:19:54
When customer submits email via contact form 7, how do I check if email already exists in my database and change notification message to "Your email already exists in our database" So far I have tried using before_send hook, but when I click submit, the page just hangs and no confirmation message. Below is the function I have in my functions.php add_action( 'wpcf7_before_send_mail', 'check_email' ); function check_email( $cf7 ) { $email = $cf7->posted_data["email"]; if($email == 'Is in our database'){ echo ('Your email exists in our database'); } } Thanks for your help d79 I've added a filter

Extending Contact Form 7 Wordpress plugin by using hooks

我怕爱的太早我们不能终老 提交于 2019-12-04 15:32:04
问题 I would like to create a plugin that uses the contact form 7 hook, wpcf7_admin_after_mail. I want to use the plugin to interface with a CRM system. What I have thus far is the following: //plugin header here function add_to_CRM( $cf7 ) { if (isset($cf7->posted_data["your-message"])) { full_contact($cf7); } else { quick_quote($cf7); } return $cf7; } add_action('wpcf7_admin_after_mail', 'add_to_CRM'); //other functions here I can't seem to get this working. I can't even get the hook to work and

Remove Contact Form 7 CSS and JS Unless Contact form 7 shortcode is used in the page

走远了吗. 提交于 2019-12-04 14:19:03
问题 I want to show the css and javascript only when the shortcode is used in that page. If the short code not present in the wordpress page then the js and css of contact form should not be shown. For that what i have done is i have pasted the following code in my active themes function.php file. add_filter( 'wpcf7_load_js', '__return_false' ); add_filter( 'wpcf7_load_css', '__return_false' ); The above code totally removes the js and css of contact form 7 plugin. What i need is if contact form 7

How to get post title by contact form 7

旧城冷巷雨未停 提交于 2019-12-04 11:53:17
I'm using contact form 7 in a website for get REQUEST QUOTE of each product. Link to example When visitor submit the REQUEST QUOTE form then I get a mail with desalts and want to get each single post title in that mail. I used [_post_title] code for get single post title and I got title. But I got only one post title from top of the page. How I can get every single post title in the mail ? IT NHAT VIET Here you are, [_remote_ip] This tag will be replaced by the sender’s client IP address. [_user_agent] This tag will be replaced by the sender’s user agent information. [_url] This tag will be

How to use Wordpress Contact Form 7 in my own HTML?

≡放荡痞女 提交于 2019-12-04 04:41:18
I want to use Wordpress Contact Form 7 on my website, but I already have an HTML/CSS layout for it. So, I want to modify the plugin to use it with that custom HTML code. <form id="contact_form" action="" method="post"> <div> <label for="contact_name">Nombre</label> <input id="contact_name" type="text" required aria-required="true" placeholder="Nombre"> </div> <div> <label for="contact_email">Email</label> <input id="contact_email" type="mail" name="email" required aria-required="true" placeholder="su@email.com"> </div> <div id="area_message"> <label for="contact_message">Mensaje</label>

Contact form 7 Datepicker, date range between 2 dates

妖精的绣舞 提交于 2019-12-03 21:46:56
I would like to have two date field in my Wordpress contact form 7. A start-date and an end-date. The fields will be datepickers from the "Contact Form 7 Datepicker" plugin. When visitor has selected a start-date he should only be able to select an end date that is 4 days later then the start-date. How can I achieve this by only using the "contact form 7" form creator? This is the syntax I put in the "contact form 7". Start date charter*: [date* date-start date-format:MM_d_yy] End date charter*: [date* date-end date-format:MM_d_yy] And I added this code to the end of the functions file of the

Contact Form 7 - add custom function on email send

荒凉一梦 提交于 2019-12-03 17:47:59
问题 Just playing around with Wordpress / Contact Form 7 . Is it possible to add custom javascript function on successful email send event? 回答1: Write this in additional settings at the bottom of the contact form configuration page: on_sent_ok: "some js code here" UPDATE: You can use it to call functions like this: on_sent_ok: "your_function();" Or write some code (this one redirects to thank you page): on_sent_ok: "document.location='/thank-you-page/';" 回答2: Contact Form 7 emits a number of

How can I remove the span wrapper in Contact Form 7?

徘徊边缘 提交于 2019-12-03 10:05:27
I use Contact Form 7 in my WordPress theme. It is currently returning span and input : <span class="wpcf7-form-control-wrap name"> <input type="text" name="name" class="wpcf7-form-control wpcf7-text wpcf7-validates-as-required form-control" id="name"> </span> But I need only input : <input type="text" name="name" class="wpcf7-form-control wpcf7-text wpcf7-validates-as-required form-control" id="name"> How can I remove the span wrapper? I faced the same problem and finally ending by using the wpcf7_form_elements filter to remove the <span> tag with a regex. You can for example copy-paste this

Extending Contact Form 7 Wordpress plugin by using hooks

浪子不回头ぞ 提交于 2019-12-03 09:45:10
I would like to create a plugin that uses the contact form 7 hook, wpcf7_admin_after_mail. I want to use the plugin to interface with a CRM system. What I have thus far is the following: //plugin header here function add_to_CRM( $cf7 ) { if (isset($cf7->posted_data["your-message"])) { full_contact($cf7); } else { quick_quote($cf7); } return $cf7; } add_action('wpcf7_admin_after_mail', 'add_to_CRM'); //other functions here I can't seem to get this working. I can't even get the hook to work and do something like mail me. Anybody have any idea what I'm doing wrong here. Since I have limited

WordPress - Overriding a function in a plugin

本秂侑毒 提交于 2019-12-03 08:19:38
问题 I've been wonder for some time what the best practice is for modifying a plugin created by a WordPress user? For example there are a couple lines of code I want to change within the Contact Form 7 plugin. The function is called function wpcf7_ajax_json_echo() and is located in: wp-content > plugins > contact-form-7 > includes > controller.php Of course I could just change the code right in that file and be done, but then I'm out of luck when I want to update that plugin as my modifications