Happy New Year! I have just released Contact Form 7 1.9.1 and this version includes support of pipe notation, little bug fixes and translation updates.
Pipe Support
Imagine that you are a webmaster of a company and you need a contact form on your site which will allow the sender to select an email recipient. Let’s say that the options are the CEO of the company (ceo@example.com), the sales department (sales@example.com) and the support department (support@example.com).
You’ve been able to achieve this in the past with Contact Form 7 in this way: first, make a drop-down menu or radio button for the selection (you can do this by inserting a form tag such as:
[select recipient "ceo@example.com" "sales@example.com" "support@example.com"]
into the form template); second, enter a corresponding mail tag ‘[recipient]‘ into the ‘To:‘ field. This ensures that the email is sent to the specific address that the sender selected.
However, there has been a problem with this. By using this procedure, the email addresses are revealed over the Internet and this is not good. These addresses could then become targets of evil spammers very quickly.
So, what you need is a way to allow senders to select from closed data safely. The pipe (‘|’) support is just for this very purpose.
Change the form tag of drop-down menu to:
[select recipient "CEO|ceo@example.com" "Sales|sales@example.com" "Support|support@example.com"]
If you insert a pipe (‘|’) character in the middle of the option value, only the part before the pipe will be open to the outside, and the part after the pipe will be used for mail replacement.

You can use this pipe only in the drop-down menu values, radio buttons or checkboxes. If you don’t like this feature, you may define the constant WPCF7_USE_PIPE as false to disable it.
Translation Updates
New additions:
- Georgian (ka_GE) – Nodar Davituri
Updated:
- German (de_DE) – Ivan Graf
- Brazilian Portuguese (pt_BR) – Henrique Vianna
- Romanian (ro) – Stas Sushkov
- Persian (Farsi; fa_IR) – Mohammad Musavi
- Hungarian (hu_HU) – Andras Hirschler
Thank you very much!
(Japanese / 日本語)
明けましておめでとうございます。Contact Form 7 1.9.1 をリリースしました。パイプ記法のサポート、少量のバグ修正、翻訳のアップデートが含まれています。
パイプのサポート
あなたが会社のサイトのウェブマスターになった場面を想像してください。そのサイト上に、送信者が宛先を選択できる仕組みのコンタクトフォームを設置することになったとしましょう。わかりやすい例として会社の CEO (ceo@example.com)、営業担当(sales@example.com)、サポート担当(support@example.com) の3つから宛先を選択できることにします。
こういったコンタクトフォームは、これまでの Contact Form 7 を使っても実現することは可能でした。まずドロップダウンメニューかラジオボタンを設置して (つまり次のようなフォームタグをフォームのテンプレート内に挿入するわけですが)、
[select recipient "ceo@example.com" "sales@example.com" "support@example.com"]
次にこれに対応するメールタグ ‘[recipient]‘ を ‘宛先:‘ の項目に入力します。こうすることでメールは送信者が選んだアドレスに送信されることになります。
ところが、これには問題がありまして、この方法を用いた場合、選択するメールアドレスがインターネットに公開されることになり、簡単にスパムのターゲットにされてしまうという好ましくない事態を招いてしまいます。
というような事情で、データは公開したくないがそのデータを選択対象としては使いたいというニーズを安全に満たす必要が出てきたわけですが、パイプ (‘|’) のサポートはまさにこの目的のためにあるのです。
先述のドロップダウンメニューのタグを次のように変更しましょう:
[select recipient "CEO|ceo@example.com" "営業担当|sales@example.com" "サポート担当|support@example.com"]
オプションの値の中でパイプ文字 (‘|’) が使われている場合、外部に公開されるのはパイプより前の部分だけで、またメールのテンプレートで使われるのはパイプより後の部分になります。
パイプをこの機能で使うことができるのはドロップダウンメニュー、ラジオボタン、チェックボックスの場合に限られます。もしこの機能が好きにはなれなくて無効に(つまり以前と同じに)したい場合は、WPCF7_USE_PIPE 定数を false として定義すればそうなります。
翻訳のアップデート
新規追加:
- グルジア語 (ka_GE) – Nodar Davituri
既存の更新:
- ドイツ語 (de_DE) – Ivan Graf
- ブラジル・ポルトガル語 (pt_BR) – Henrique Vianna
- ルーマニア語 (ro) – Stas Sushkov
- ペルシャ語 (Farsi; fa_IR) – Mohammad Musavi
- ハンガリー語 (hu_HU) – Andras Hirschler
みなさんどうもありがとう!
Leave a comment