Veldform / Docs · WordPress plugin
Merge tags
Merge tags let you use submitted values in notifications, confirmation messages, redirect URLs, API requests and payment descriptions. They use the Liquid template syntax:
Hi {{ raw.f_name.first }}, thanks for your message!
Wherever merge tags are supported, the editor has a tag button that lists all available tags for your form, you never have to guess a field ID.
Available tags
| Tag | Description |
|---|---|
{{ field.f_email }} |
A field value, formatted for display |
{{ raw.f_email }} |
The raw submitted value |
{{ raw.f_name.first }} |
A part of a composite field, name parts (first, last...) and address parts (city, postal...) |
{{ all_fields }} |
All submitted fields as label + value blocks, the default notification body |
{{ output.order_id }} |
An output of an earlier action, such as a captured API response value |
{{ form.title }} / {{ form.id }} |
The form title and ID |
{{ entry.id }} |
The entry ID |
{{ entry.date }} |
The submission date |
{{ entry.url }} |
A link to the entry in the admin |
{{ admin_email }} |
The site admin email address |
{{ order_total }} |
The order total of the product fields |
{{ query.utm_source }} |
A URL query parameter, available at render time only, e.g. for prefilling |
{{ user.email }} |
The logged-in visitor, also render time only. Available: id, email, display_name, first_name, last_name |
Filters
Values can be piped through filters. All standard Liquid filters work, upcase, downcase, capitalize, date, default, truncate, split, replace and so on:
{{ field.f_name | upcase }}
{{ field.f_company | default: "Unknown" }}
Veldform adds four filters of its own, mainly for building JSON bodies for API requests:
| Filter | Description |
|---|---|
json |
JSON-encodes the value: quotes and escapes strings, leaves numbers and booleans bare |
to_int |
Casts to a whole number |
to_float |
Casts to a floating point number |
to_bool |
Casts to true/false |
Chain them to get correctly typed JSON:
{ "guests": {{ field.f_guests | to_int | json }} }
Developers can register their own filters with the veldform/liquid/filters hook, see Action and filter hooks.
Conditions and loops
Since it's Liquid, you get logic too:
{% if field.f_type == "business" %}
A business inquiry from {{ field.f_company }}.
{% else %}
A personal inquiry.
{% endif %}
One thing to watch out for when using {% if %} inside a custom JSON body: a condition that removes a line can leave a stray comma behind. Keep conditional parts at the end of the object, or keep the logic inside the value.