Message templates

Templates control what the Telegram message says. They use the same [field-name] tag syntax you already know from Contact Form 7 mail settings, plus a set of special tags.

The default message

A connection without a template uses the built-in default:

📩 New form submission

Form: [_form_title]
Site: [_site_title]
Date: [_date] [_time]

[all_fields]

[all_fields] expands to a name: value line for every submitted field (empty fields are skipped).

Field tags

Every form field is available as a tag named after the field. For a form with your-name, your-email, and your-message fields:

🔥 New lead from [your-name]

Email: [your-email]

[your-message]

Checkbox and multi-select values are joined with commas.

Special tags

TagValue
[all_fields]All submitted fields as a name: value list
[_form_title]Form title
[_site_title]Site title
[_site_url]Site URL
[_page_url]Page the form was submitted from
[_date]Submission date (site date format)
[_time]Submission time (site time format)
[_user_ip]Visitor IP address
[_user_agent]Visitor browser (user agent)

HTML formatting

Each template has a parse mode: plain text or Telegram HTML. With HTML enabled you can use the tags Telegram accepts:

<b>, <strong>, <i>, <em>, <u>, <ins>, <s>, <strike>, <del>, <a href="…">, <code>, <pre>, <blockquote>, and <tg-spoiler>.

<b>New lead</b> from <a href="[_page_url]">[_form_title]</a>

<b>Name:</b> [your-name]
<b>Email:</b> <code>[your-email]</code>

<blockquote>[your-message]</blockquote>

Field values are automatically HTML-escaped when the template is sent in HTML mode, so user input can never break your markup or inject links.

Testing templates

Use the Test action on a connection to render the template with sample field values and deliver it to the connected chats — the fastest way to iterate on formatting.

For developers

The rendered text and the placeholder map can both be modified with filters — see b418_wp_tg_cf7_message_text and b418_wp_tg_cf7_placeholders.