Categories
Announcement WordPress Plugins

Contact Form 7 1.10

Contact Form 7 1.10 is now available. New features in this version include additional mail headers, response message placeholder tags [response], the calling of user-specified JavaScript code when a message is sent successfully, controlling JavaScript loading with new constant, and much more. Therefore, I would highly recommend that you upgrade today!

Download | Plugin Homepage | FAQ | Support Forum

(日本語のドキュメントは下のほうにあります。)

Additional Mail Header

In the past, Contact Form 7 allowed you to set mail headers of To, From and Subject. Have you ever thought of adding Cc or Bcc headers to your mail? The newly introduced Additional Headers fields in the Mail and Mail (2) section are just for that purpose.

You can input any header lines into the field; and you can insert any tags into any place in each header line, just like other Mail fields.

additional-headers

[response] Tag

After a reader of your blog submits the contact form, he or she sees a response message from Contact Form 7, such as “Your message was sent successfully” or “Validation errors occurred.” I sometimes hear from users who tell me that the position of the response message is not good, and, in fact, sometimes their visitors miss the message entirely.

In the past, the response message was shown at the bottom of the form. I changed this by allowing users to locate their response massage placeholder as they like. The response message is shown within the placeholder after submission.

A tag [response] for the placeholder has been introduced. You can insert this [response] tag into any place of your choice in your form. You can use it multiple times in a form. If there is no [response] used, the response message is shown at the bottom of the form by default.

JavaScript Action Hook: on_sent_ok

Sometimes you might think of running custom codes after the form has been submitted. For example, you may wish to run Google Analytics’s tracking code for tracking their visitor’s usage of the contact form and counting it as conversions.

The new JavaScript action hook would be useful in such a case. If you have a JavaScript code you wish to run after form submission is completed successfully, simply insert the code into the Additional Settings section (which is new in this version and is placed at the bottom of the admin panel) with preceding on_sent_ok keyword, like this:

on_sent_ok

Note that you need to quote the codes properly; and the code must be in one line.

To show you a more practical example, if you want to insert Google Analytics’s tracking function, enter it like this:

on_sent_ok: "pageTracker._trackPageview('/funnel_G1/step1.html');"

Controlling JavaScript Loading with WPCF7_LOAD_JS Constant

By default, Contact Form 7 loads three JavaScript files — contact-form-7.js, jquery.form.js and jquery.js — into each page. They are necessary for Ajax. I believe that the smooth form submission with Ajax is one of the better points of Contact Form 7; however, I’ve heard from users they don’t like this feature and think the loading of these JavaScripts is wasteful. So I have made it controllable.

When the value of WPCF7_LOAD_JS is set to false (default: true), Contact Form 7 does not load the JavaScript. You can set the value of this constant in your wp-config.php like this:

define ('WPCF7_LOAD_JS', false );

Tip: If you set WPCF7_LOAD_JS as false, but you wish to load the JavaScripts only on specific pages, call wpcf7_enqueue_scripts() in your template file. Note that wpcf7_enqueue_scripts() must be called before wp_head() is called.

Other Changes

  • Now you can specify the file upload limit size with kb and mb unit symbols. These three tags have the same meaning:

    [file your-file limit:1048576]
    [file your-file limit:1024kb]
    [file your-file limit:1mb]

    Note that you can’t use a decimal point in it (i.e., like this: [file your-file limit:1.5mb]) and it will be ignored if it exists.

  • A donation banner is displayed on the admin panel randomly. You might not see it as it is shown with very low probability.

    If you, or your client, hate to see anything about donations, you can stop displaying this banner by setting the value of WPCF7_SHOW_DONATION_LINK constant as false in your wp-config.php like this:

    define( 'WPCF7_SHOW_DONATION_LINK', false );

  • wpcf7_version(), wpcf7_read_capability() and wpcf7_read_write_capability() are removed. Use constants instead.
  • JavaScript is loaded in footer, instead of in a header, if it is allowed to do so. This has good performance merit.
  • Support of HTTPS is partly improved by using plugins_url().
  • An overall relocation and refactoring of codes and files has been done.

Translation Updates

New addition:

Updated:

Thank you.

Click here to lend your support to: Support Contact Form 7 and make a donation at www.pledgie.com !


(in Japanese from here)


Contact Form 7 1.10 をリリースしました。追加メールヘッダー、応答メッセージのプレースホルダーとしての [response] タグ、メッセージ送信に成功した時の JavaScript 呼び出し、定数での JavaScript ロードの抑制、などなど、たくさんの機能をこのバージョンでは導入しています。この機会にアップグレードをおすすめします。

追加メールヘッダー

従来の Contact Form 7 では To (宛先)、From (送信元)、Subject (件名) のメールヘッダを指定できました。これに CcBcc のヘッダーを追加したいと思ったことはありませんか? メールメール(2)両セクションに新しく導入した追加ヘッダー項目はまさにこのためのものです。

このフィールドに任意のメールヘッダー行を入力してください。それから、メールセクションのほかの項目と同様に、好きな場所にタグを挿入できます。

additional-headers

[response] タグ

ブログの訪問者がコンタクトフォームで送信すると、その訪問者は Contact Form 7 の応答メッセージを見ますよね。「あなたのメッセージを送信しました」とか「入力内容に不備があります」とか、そういうのです。よくユーザーから言われていたのですが、この応答メッセージを表示する場所がよくないので、訪問者がたびたびこのメッセージを見落としてしまうのだそうです。

従来のバージョンではこの応答メッセージをフォームの一番下に表示するようにしていたのですが、今回これを変更して、ユーザーが自由な位置に応答メッセージのプレースホルダーを置けるようにしました。応答メッセージは送信後にこのプレースホルダーの中に表示されるようになります。

このプレースホルダーを表現するタグとして、[response] を新たに導入しました。これをフォームセクションの中でならどこでも、何回でも挿入できます。もし [response] が1回も使われていなかったら、従来どおりフォームの一番下に応答メッセージを表示します。

JavaScript アクションフック: on_sent_ok

フォームの送信が完了した時に何かコードを実行したい、と思うこともあるかもしれません。例えば、Google Analytics のトラッキングコードを走らせて、訪問者のフォーム利用を追跡したり、それをコンバージョンとしてカウントしたりとか。

新しく導入した JavaScript アクションフックはそんなときに便利です。フォームの送信に成功した時に実行させたいコードがあったら、その先頭に on_sent_ok のキーワードをつけて、「その他の設定」セクション(これもこのバージョンで新規導入されたもので、管理パネルの一番下にあります)に挿入するだけです。こんな感じ:

on_sent_ok

コードを適切な引用符で囲む必要があるので気をつけてください。それからコードは1行に収まっていないといけません。

もっと実用的な例として、Google Analytics のトラッキング関数を使うならこんな感じになります:

on_sent_ok: "pageTracker._trackPageview('/funnel_G1/step1.html');"

WPCF7_LOAD_JS 定数による JavaScript ロードの抑制

デフォルトでは Contact Form 7 は contact-form-7.js、jquery.form.js、jquery.js の3個の JavaScript ファイルを個々のページでロードします。これは Ajax の機能に必要です。Ajax を使った滑らかな送信動作というのは Contact Form 7 の良いところのひとつだと自負していますが、聞くところによるとこの機能が好きではなく、このために JavaScript ファイルを読み込むのも無駄でしかないと考えている(いけすかない!)ユーザーもいるようです。仕方がないので、この機能をオン・オフ変更できるように変えました。

WPCF7_LOAD_JS 定数の値が false の場合(デフォルトでは true)、Contact Form 7 は JavaScript をロードしません。定数を設定するなら wp-config.php の中でこんな風にするといいでしょう:

define ( 'WPCF7_LOAD_JS', false );

裏技: WPCF7_LOAD_JSfalse に設定したものの、特定のページでは JavaScript を読み込ませたいという場合は wpcf7_enqueue_scripts() をテンプレートファイルの中で呼び出してください。wpcf7_enqueue_scripts()wp_head() より先に実行される必要があるので注意してください。

その他の変更

  • ファイルアップロードのサイズ上限指定に kbmb の単位シンボルが使えるようになります。次の3個のタグはどれも同じ意味になります。

    [file your-file limit:1048576]
    [file your-file limit:1024kb]
    [file your-file limit:1mb]

    小数点つきの値は使えないので注意してください。例えば [file your-file limit:1.5mb] のような指定をしても無視しますので。

  • 寄付呼びかけのバナーを管理画面に置かせてもらってます。ランダム表示でかなり低い確率でしか表示させないようになっているので、ひょっとしたら目にする機会はないかもしれませんが。

    もしあなたが(またはあなたの顧客が)寄付のことなど見るのも汚らわしいと感じているようでしたら、WPCF7_SHOW_DONATION_LINKfalse に指定して表示を解除してください。wp-config.php にこんな風に書くとよいでしょう:

    define( 'WPCF7_SHOW_DONATION_LINK', false );

  • wpcf7_version()wpcf7_read_capability()wpcf7_read_write_capability() の各関数を削除しました。もしこれらの関数を使っていたなら、今後は代わりに定数を使ってください。
  • JavaScript のロードをヘッダではなくフッタで行うようにしました(それが可能な場合のみ)。これによりパフォーマンスが多少よくなると思います。
  • plugins_url() を使用するようにしたことで HTTPS のサポートが多少改善されているはずです。
  • 全体的にファイル配置の見直しやコードのリファクタリングを行いました。

翻訳の更新

新規追加:

更新:

ありがとうございました。

Click here to lend your support to: Support Contact Form 7 and make a donation at www.pledgie.com !

70 replies on “Contact Form 7 1.10”

Just downloaded this, however, I cant seem to find the “Generate Tag” menu anymore. Is this a bug? I’m using Firefox 3.

Hi, this plugin is not corrrect installed. Plz check the folder.
On my Site the css folder is plugin/stylesheet.css right is plugin/contact-form-7/stylesheet.css and the same is with wp-content/plugins/contact-form-7.js?ver=1.10

plz fix it fast :)

Thanks for the great work on this plugin!

I’m getting some blocking bugs with the latest version (1.10) unfortunately. This seems to be caused by incorrect paths.

Admin, no [quicktags] for the forms is showing up (see http://eyesx.pictiger.com/albums/61507/18167417/), no dropdown for generating tags shows up (see http://eyesx.pictiger.com/albums/61507/18167418/), styles are messed up (see http://eyesx.pictiger.com/albums/61507/18167419/ , http://eyesx.pictiger.com/albums/61507/18167420/).

Front, path for the css is wrong, js path is wrong.

Keep up the good job :)

Thanks for creating this plugin. I am looking forward to working with it – nut i hve been unable to use it in the admin end. The automatically generate code fields are missing, so there’s no way to use it. The area in the tutorial where the “generate tags” dropdown should be is completely blank. I have reinstalled 2 times via wordpress, then painstakingly via ftp. Please help.

please change typo from ” – nut i hve been…” to ” – but I have been…”. Sorry.

こんにちは。早速Contact Form 7 1.10をダウンロードして
使用を試みましたが、いきなりコードが表示されません。
「このコードをコピーして、投稿、ページ、またはテキストウィジェットの本文内にペーストしてください。」のところです。^^どうしたら表示されますでしょうか。ご解答のほどよろしくお願いします。

I just upgraded to Contact Form 7 version 7-1-10 and I believe there may be a bug.
When I was creating my form, the box at the top where I am to copy the code that goes into my post is blank. There is nothing to copy. In the previous version I would get something like [contact-form 1 "Contact form 1"] and when upgrading to this version that box is unpopulated. For now I have gone back to version 1.9.5.1.
Am I missing something that I should click to get that field to populate? I saved the form and everything, but there was nothing. I really like the added features to the new version too! Thank you for making such a wonderful and easy to use plugin! :)

I must apologize for this. I found a huge blocking bug of missing path when you use it on WordPress 2.6 or 2.7.x. I’ve fixed it and just released again as Contact Form 7 1.10.0.1. I’m so sorry for the inconvenience and thank you all for the trouble reports.

not quite suer about this: I just upgraded to Contact Form 7 1.10.0.1 and now run into a javascript error “box.getNotificationWithValue is not a function” throughout the site.

Hi!

I have a question?

I want to track the form submission with Google Analytics and upgrade to the new version minutes ago.

I added following code in the settings;
on_sent_ok: “pageTracker._trackPageview(‘/confirmation/’);”

User should in step 1 fill in their booking inquiry here: http://www.apartmentinrio.net/reservation/

and should be sent to the thank you page which is http://www.apartmentinrio.net/confirmation/. But the script still give the message “Your message was sent successfully. Thanks.” and do not redirect…

Can anyone help me to solve this? Thank you!

Hi Miyoshi.

Can you add a feature to the next version that will add IP address of the user to the e-mail to.

Thanks for your great plugin. :)

Hi there,
is there anyway to include a auto generated number when each form is submitted?
Thanks
Crafu

Hi, I’ve got this plugin installed on 2 blogs however on one it seems to strip off the users return email address?? It just picks up my blog admin email address as the return address and not the submitters??

It works fine on the other blog

Can anyone shed any light on this?

Hi:

I have the latest version 1.10.0.1 and I’m having the same problem. The e-mail arrives but no attachment. I’ve already read through this & another thread & tried a few things but still nothing works. In the form field it looks like this:

Your Name (required)
[text* your-name]

Your Email (required)
[email* your-email]

Subject
[text your-subject]

Your Message
[textarea your-message]

Upload a Photo for Evaluation
[file* file-350]

[submit “Send”]
and in the mail field it looks like this:

To:tlynch63@gmail.com

From:[your-name]

Subject:[your-subject]

Additional headers:

File attachments: [350]

Yet nothing seems to work. I have the latest WP as well. Any insight ?

I’m with kiwia but I’ve been adding a simple fix to the problem for many updates now. You can fix this problem (a host-based problem I believe), by changing line 30 in the current 1.10.0.1 includes/mail.php file from

$mail_headers = “From: $mail_sender\n”;

to

$mail_headers = “From: $mail_sender\nReply-to: $mail_sender\n”;

It’s not perfect since you might have to look at the headers, rather than having your reply field auto-populate (depending on your email client), but at least this way you can still tell where to send your reply!

I love this plugin and would love for you to add this fix to the plugin so I don’t have to keep adding it manually after every update :)
peace~

Hi Miyoshi,

Thank you for adding the CC and BCC fields and the way to control the tag formatting from the admin panel, they work great.

Brilliant plug-in, it works great and I love it.

Zialingua.

On 2.8-beta-2, auto upgrade fails with following message:

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 296191 bytes) in /home/jcwinnie/public_html/wordpress/wp-includes/http.php on line 1327

Please excuse my previous reply! I just looked at the post a little more carefully and noticed the part about the additional mail headers, which should cover the Reply-to: problem without needing to edit the code after every update.

For anyone like kiwia who only sees the blog email address as the return address, due to misconfigured host settings, just add something like
`Reply-to: [your-name]`
in the new ‘Additional headers.’ :)
peace~

Hi first thanks a lot for this great plugin.;)

is it possible to return the “form action url” in the mail_body?

I would like to use this plugin on every single.php and it would be very fine if I can recorgnize from which article the mail comes.
thanks
Monika

Hi junsuijin,
I couldn’t get that extra additional header to include the senders email address.

However, I did get it to work eventually by going through and de-activating other plug-ins to find possible conflicts.

The culprit was the simple-press forum plugin which had an over-riding replt email address with my admin email in there. Deleted the default address and now contact form working as should.

Hurrah.

Interesting kiwia, now that you mention it, it might have been around the time I activated simple-press plugin on my client’s site that his contact form 7 plugin stopped sending the correct sender address as well! I’ve long since gotten rid of that plugin since I could never get the newest version to work correctly, and the older version had inadequate admin features for large-scale forums. I’m using bbPress now and it’s much better :)

i love this plugin. i saw make a donate button in plugin and i donated plugin administrator. He is the man. Congratulations for great plugin and thank you so much. Please everybody donate him. It helps his development for the plugin. Regards.

kiwia, did you figure out how to get simple-press and contact form to play nicely together? I deactivated simple-press forum, but ideally would like to use it although not at the expense of losing this contact form plugin.

What really stinks is that I found out about this with an email someone sent wanting to make a donation. If you know how I might retrieve the return email address they actually entered that’d be helpful as well.

Thanks!

I am running into issues with this plugin and it has been happening for a while now.

When ever i try to test the script it comes up with “Failed to send your message. Please try later or contact administrator by other way.” now i tried disabling every plugin and it still happens.

What can i do to fix this issue?

I just upgraded Contact Form 7 plugin and tested it in my site by fillig a test form and sending it. It worked perfectly BUT… 5 minutes after the test I started to recieve tons of spam from that form. Before that I had never had any spam from that form.

What is the reason for this? Is there some notification system that notifies some spambots of working forms or what? :)

Before upgrading to the latest version, everything was good. The upgrade has now added the contact form to my home page. Previously the contact page was a separate page not on any other page. Should I downgrade? to 7? or can someone help me figure it out. I spent time looking for any embedded code, and I’m stumped not seeing why the contact page got into my home page. I am also using simple caphcha on it.

I also made the mistake of upgrading. Now every single form submission results in the following message:

Failed to send your message. Please try later or contact administrator by other way.

And no, it’s not my Akismet settings. This is very frustrating, and terrible timing for my website. I’m going to have to remove this plug-in completely and find an alternative.

Hi,

in formatting.php, function wpcf7_wpautop_substitute:

Could you please add “fieldset” and “legend” to the $allblocks?
Contact Form 7 always wraps them into <p> elements which causes a lot of problems.

Thanks,
Stefan

How can I use Google Analytics to track the form submissions? I would love to be able to forward the user to a “thankyou” page upon completion of the form. I’m trying different on_sent_okay javascript commands and not having any luck. If you would email me I would pay for help with this functionality!

Figured it out! In the Additional Settings box, paste the following:

on_sent_ok: window.location = “http://www.yoursite.com/thankyou.html/”

Hi

I recognize by first testing your contact form that it does not submit the email adress of the sender.

The mail I receive is containing one of my own adresses. That´ s so strange. Where does it take that from?

Any ideas?#

BR, St.

Can someone verify that this plugin works in WP 2.8? It’s not working for me anymore, no e-mail is actually sent, but I don’t know if it’s the WP upgrade or something else.

Is there any way i can have an additional outgoing mail similar to “Mail”, Mail(2).

i can add “Mail(3), Mail(4)”?

CC or BCC is a solution for additional mails but i want it to have a “different message content” with the others, specified in a single email.

Thank you!

Hi

Running WP 2.8.1 with latest download of Contact Form 7 1.10.1

I have tired both Google Analytics code as suggested
n_sent_ok: “pageTracker._trackPageview(‘/funnel_G1/step1.html’);”

and also redirecting to a thank you page to get Analytics working that way.

on_sent_ok: window.location = “http://www.mortgagecorp.com.au/thank-you/”
(all on one line)

Neither work, the Google code just makes it a little turning wheel (but does send an email but doesnt appear to trigger a goal and doesnt show the status of the email ie succeess

The other one doesnt redirect, it just sits there, no error messgage but also sends an email.

Appreciate any advice as to how I am screwing this up. Thanks

Mike

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s