How To, Plugins  

Easy Contact form 7 Guide, Customization and most wanted tips.  Set replay to. change submit button style. Add multi recipients , BB or BCC.  Get all the sender info right inside email body. and give sender a copy too!

—————– Mail section ———–

Example: http://screencast.com/t/YjEzYmI1NGEt

  • To: field: The e-mail address that will receive the results.( enter your email )Note: You can add multi recipients. separate them with commas:
    example: Admin@example.com,log@example.com,me@example.com

    you also can display a selection of receptions to select.
    Example: [select recipient "CEO|ceo@example.com" "Sales|sales@example.com" "Support|support@example.com"]


  • From: field: sender email. example [your-name] <[your-email]>
  • Subject: field:  mail subject. example: [your-subject]
  • Additional headers: type in Reply-To: [your-email]
    (Very important) This will allow you to reply to the person directly when you are reading the email later.You also can add CC and BCC if you need.

    Example:
    CC: mom@example.com
    BCC:dad@example.com

  • Message Body field: Type like following:( thenyou will see all info in one place in email body)[your-message]Subject:[your-subject]
    Name: [your-name]
    Email: [your-email]
    Website: [your-website]
    IP: [_remote_ip]

—————— Mail section 2 ———————

Its good to send another email to sender to let him know we recived his email.

See  example: http://screencast.com/t/ZTE0OTAyYT

If you like to see it in action, Try my contact page and say thank you to me! You will get similar to above screen-shot immediately in your mail box!

————— Messages —————————-

After  form is submitted the viewer is able to see the response messages such as “Your message was sent successfully”, “Validation errors occurred.” etc.

You can change all kind of message that may appear to the sender here.

Example: http://screencast.com/t/NTRlYWU2M

————- Additional Settings ——————-

Good place to add your own JS script. for example if you want to nevigate to a thank you page after submitting a message you can write like this:

on_sent_ok: “location.replace(‘http://yourdomain.com/thank-you/’);”

*How to auto fill a form input?

Add a id to that input.

use below javascript plus exct php plugin to run the code within your post:


* how to change style of submit bottom?

Add a class to submit button :

example: <p align="left">[submit class:buttons_mainpage " "]</p>

then add the  style like this:

.buttons_mainpage {
	background-image: url("images/but_submit.png");
	background-repeat: no-repeat;
	margin: 0px 190px 0px 0px;
	padding: 0px;
	float: right;
	height: 26px;
	width: 69px;
	border: 0 none;
	cursor: pointer;
}

* How to erase fields on focus

No easy way! You need edit edited \modules\text.php and replace

$html = '
'

with

$html = '<input type="text" name="' . $name . '" value="' . esc_attr( $value ) . '"' . $atts . ' onfocus="if(this.value==\'';

$html = $html . esc_attr( $value ) . '\') this.value=\'\';" onblur="if(this.value==\'\') this.value=\'' . esc_attr( $value ) . '\';" />';

* how to allow only admin edit the contact  form and prevent others?

define( 'WPCF7_ADMIN_READ_CAPABILITY', 'manage_options' );
define( 'WPCF7_ADMIN_READ_WRITE_CAPABILITY', 'manage_options' );

read more about manage_options http://codex.wordpress.org/Glossary#Capabilities

* How to insert contact name and email in database after sucessfull submission?

Contact Form 7 has many action/filter hooks in its code. So, if you are familiar with WordPress plugin development, you can use them to save data into DB.  best hook for it at wpcf7_before_send_mail in includes/classes.php

Example:

add_action( ‘wpcf7_before_send_mail’, ‘my_conversion’ );

function my_conversion( $cf7 )
{
$email = $cf7->posted_data["your-email"];
$name = $cf7->posted_data["your-name"];
insert_newsletter_subscriber($email, $name);
}

Note:  You need to write  your own insert_newsletter_subscriber()

———————–  Tip ————————

You can use folowingspecial mail tags  in main body too:

[_remote_ip] This tag will be replaced by the sender’s client IP address.
[_url] This tag will be replaced by the URL of the contact form.
[_date] This tag will be replaced by the date of the submission.
[_time] This tag will be replaced by the time of the submission.
[_post_id] This tag will be replaced by the ID of the post which contains the contact form.
[_post_name] This tag will be replaced by the name (slug) of the post which contains the contact form.
[_post_title] This tag will be replaced by the title of the post which contains the contact form.
[_post_url] This tag will be replaced by the permalink of the post which contains the contact form.
[_post_author] This tag will be replaced by the author name of the post which contains the contact form.
[_post_author_email] This tag will be replaced by the author email of the post which contains the contact form.

Note that the [_post_*] tag has value only when you put the contact form into content of a post or a page. They are not available if the contact form is put inside a sidebar widget.

The form of those special mail tags has been changed in Contact Form 7 2.2. Old form ([wpcf7.*]) are still supported and able to work.

———————–  Tip ————————

If you want to show a rest form button, add this:
<input type="reset" />

———————–  Tip ————————

if you want to show post title in email body add this:
[wpcf7.post_title]

———————–  Tip ————————

By default, Contact Form 7 loads three JavaScript files — contact-form-7.js, jquery.form.js and jquery.js — into the header of each page. They are necessary for Ajax. If you want to disable such loading of these files in all pages and control it to load in select pages only, you can do that by first prevent their loading totally by inserting the following line in the wp-config.php file.

define ('WPCF7_LOAD_JS', false );

Then you may call these files to load in a particular file by inserting the following line in the relevant template ahead of the call to wp_head():

wpcf7_enqueue_scripts();

Using this tip can improve your WordPress page loading and SEO!

———————–  Tip ————————

you can use tag  [response] anywhere you like. this tag is like place holder for displaying message. all message appear where you place a tag [response].

Do you know additional WordPress Contact Form 7 plugin tips? Please share it via commnets

Need Farther help and support? Contact me

Looking for different WordPress plugin? Try  Wishlist member wordpress plugin.

  • Share/Bookmark

Add your comment


  1. Mehmet
    May 1, 2010
    7:52 am

    Hi,

    About “how to change style of submit bottom?”

    Which file should i add this class and where (row):
    [submit class:buttons_mainpage " "]

    thank you.


  2. Carolyn
    June 1, 2010
    7:17 pm

    I am having trouble getting sent the info I request with the special mail tags… I feel really stupid! Just getting [wpcf7.post_title] back!


  3. Andy
    June 6, 2010
    11:34 pm

    Hello Carolyn, special mail tags work perfect in contact form 7 only. if you installed contact form 8.then time to uninstall it and back to 7!
    Remember you can use [_post_title] instead of [wpcf7.post_title] too


  4. Steven
    June 9, 2010
    8:09 pm

    Hello,
    I would like to remplace a caracter in a tag:

    example@test.com replaced by exemple=test.com

    Do You know if anything is possible?

    Thx


  5. Morgan Daly
    July 4, 2010
    5:26 am

    Hello,

    You seem to know a fair bit. Do you know if it is possible to extend Contact Form 7 so that there was Mail (3) & Mail (4). At the moment there is an option to have Mail (2). Adding more of these would be awesome. Any ideas?

    Thanks
    Morgs


  6. Ash
    July 9, 2010
    9:14 am

    Hi Andy

    Is there anyway i can get [_post_url] to work when using the Contact Form 7 widget?


  7. john
    July 12, 2010
    10:35 am

    How do you add onfocus to a textarea?


  8. Peter
    August 16, 2010
    9:33 am

    I want to autofill content of a field when a user clicks on the link on a different page.

    Is there someway to send a url string with variables that auto fill a field?

    Or maybe some java trick?


  9. Andy
    August 18, 2010
    8:47 am

    This is easy to do by using jQuery .


  10. Stacey
    August 23, 2010
    12:55 pm

    hey do you have any advice on “auto submitting”?


  11. Steve Pasek
    August 31, 2010
    5:12 pm

    Seems that the drop-down recipient functionality has broken. The drop-down menu just doesn’t appear, only the label (“choose the recipient”).
    Version 2.3.1 Contact Form 7
    Version 3.0.1 WordPress
    Is there a solution for this?


  12. Andy
    September 1, 2010
    9:22 am

    Hey Stacey. Please use jQuery to auto submit any form.

RSS feed for comments on this post. TrackBack URL

Add your comment.





( DoFollow )

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Home | WordPress | Themes | Plugins | Download | Forum | Freelance | Resume | Projects | Service | Contact | About
Copyright 2009 Hecode.com