Smartcodes
Every {code} that puts answers, entry details, the person, the page and the site into words.
Smartcodes are {group.key} placeholders that Kindly Forms fills in with answers and other values: in labels, help, default values, confirmations, emails, redirect addresses, connections and documents. In the builder, the button beside a setting (Insert an answer or other value) lists them, this form's answers first.
The groups below come from kindly_forms_smartcode_catalog() in includes/forms/rest.php, which is the list the builder's picker shows. The extra codes after each table are understood by kindly_forms_smart() (includes/forms/smartcodes.php) and by the parts that add their own, but are not in the picker. The names match Fluent Forms', so forms brought over from it keep working.
How they are filled in#
- Missing values are empty. A code whose group Kindly knows but whose value is missing, such as an answer left blank, becomes empty.
- A fallback goes after a bar:
{inputs.first_name|friend}gives "friend" when there is no first name. - Text in braces that isn't a smartcode stays as written. A group Kindly doesn't know (
{color}, CSS such as{ margin: 0 }) is left alone. - Escaping. In HTML (emails, confirmations) values are escaped so answers can't add markup. In addresses (redirects, webhook URLs) they are encoded, except a value that is itself a web address.
{all_data}, the receipt and the order summary are HTML tables and are not escaped. - Secrets never resolve. Passwords, activation keys, session tokens and protected meta keys (starting with
_, or containing words likepass,secret,tokenorkey) give nothing. - Hidden answers. Answers to fields hidden by conditions are not kept, so their codes are empty.
Answers#
Every field of the form is in the picker as {inputs.KEY}, where KEY is the field's Field key.
| Code | Gives |
|---|---|
{inputs.KEY} |
The answer as people read it: a choice's words, a full name, an address on lines, file names |
{inputs.KEY.value} |
The stored value: a choice's value instead of its words |
{inputs.KEY.label} |
The choice's words |
{inputs.names.first}, {inputs.address.city} |
One part of a name or an address (first_name and address_line_1 work too) |
{labels.KEY} |
The field's label |
{all_data} |
Every answer the person could see, as a table (or lines in a plain-text email) |
{all_data_without_hidden_fields} |
The same without Hidden value fields |
{input.KEY} works like {inputs.KEY}. In the form itself, {inputs.KEY} in a Words and links field (and {dynamic.KEY}) changes as the person types.
When files are kept only in cloud storage, {inputs.KEY} on an upload field gives the cloud links. See File storage.
Form and entry#
| Code | Gives |
|---|---|
{form_title} |
Form name |
{form.id} |
Form id |
{submission.id} |
Entry id |
{submission.serial_number} |
Entry number (counts up per form) |
{submission.created_at} |
Sent at, in the site's date and time format |
{submission.source_url} |
Sent from (page address) |
{submission.admin_view_url} |
Link to the entry in Kindly Edit > Forms |
{submission.entry_uid_link} |
The entry's answers page address, the same as {entry_link} |
{submission.payment_total} |
Amount paid |
Also understood: {form.title}; {submission.status}, {submission.browser}, {submission.device}, {submission.user_id}, {submission.ip}, {submission.currency}, {submission.payment_status}, {submission.payment_method}, {submission.entry_uid} and {submission.meta.KEY}. {entry.KEY} is the same as {submission.KEY}.
From the form's own pages (Quizzes, form pages and post forms):
| Code | Gives |
|---|---|
{entry_link} (or {entry.link}) |
The private address of the page showing the sender's answers, when Settings > Answers page has Give each entry its own page turned on |
{form_page} (or {form.page_url}) |
The form's own page address |
Use {entry_link} to send people to their answers page.
Payment#
| Code | Gives |
|---|---|
{payment.receipt} |
Receipt |
{payment.summary} |
Order summary |
{payment.payment_status} |
Payment status |
{payment.payment_method} |
Payment method |
{payment.transaction_id} |
Transaction id |
Also understood: {payment.payment_total} (or {payment.total}), {payment.order_items}, {payment.card} (brand and last four digits), {payment.currency}, {payment.coupon}, {payment.discount}, {payment.refunded}, {payment.subscription}, {payment.subscription_status}, {payment.instructions} (the offline payment instructions) and {payment.receipt_url}. See Payments.
The person#
| Code | Gives |
|---|---|
{user.display_name} |
Name |
{user.first_name} |
First name |
{user.last_name} |
Last name |
{user.user_email} |
|
{user.ID} |
User id |
{user.meta.KEY} |
A profile value |
{ip} |
Network address |
{browser.name} |
Browser |
{browser.platform} |
Device |
{user.*} is the signed-in person, empty for visitors who aren't signed in. Other profile fields, such as {user.user_login}, work too.
The page#
| Code | Gives |
|---|---|
{embed_post.post_title} |
Page title |
{embed_post.permalink} |
Page address |
{embed_post.ID} |
Page id |
{embed_post.meta.KEY} |
A page value |
{embed_post.author.display_name} |
Page author |
{http_referer} |
Came from |
{get.PARAM} |
From the address (?PARAM=) |
{cookie.NAME} |
A cookie |
The page is the one the form was sent from. {embed_post.acf.KEY} reads an Advanced Custom Fields value when that plugin is active. {post.KEY} is the same as {embed_post.KEY}. {get.PARAM} suits a Hidden value's Default value, for example {get.utm_campaign}.
The site#
| Code | Gives |
|---|---|
{wp.site_title} |
Site name |
{wp.site_url} |
Site address |
{wp.admin_email} |
Site email |
{date.m/d/Y} |
Today |
{date.g:i a} |
Time now |
{random_string.ref-} |
A random reference |
{date.FORMAT} takes any PHP date format, in the site's time zone. {random_string.PREFIX} gives the prefix and 13 random characters. Also understood: {wp.site_description} and {admin_email}.
Quiz#
| Code | Gives |
|---|---|
{quiz_result} |
Quiz result: the grade and score ("8 of 10 points (80%)"), or for a personality quiz, the personality and its description |
{quiz.score} |
Score |
{quiz.grade} |
Grade |
{quiz.personality} |
Personality |
Also understood: {quiz.possible} (or {quiz.total}), {quiz.percent}, {quiz.right} (or {quiz.correct}), {quiz.questions}, {quiz.personality_text} and {quiz.answers} (a table of each question, the answer and whether it was right). See Quizzes, form pages and post forms.
Documents, stock and connections#
These come from other parts of Kindly Forms:
| Code | Gives |
|---|---|
{pdf.download_link} |
Download link of the form's first document (in the picker under Documents) |
{pdf.download_link.DOC}, {pdf.url.DOC} |
The link or address of one document |
{pdf.items}, {pdf.page_break} |
Inside a document only: the items and total (or the answers), and a new page |
{inventory.SLUG} |
How many of a shared stock item are left; .total, .used and .name give the others |
{chatgpt.FEED} (or {openai.FEED}) |
The reply an OpenAI connection wrote for this entry |
{resume_link} |
In the Save and finish later email only: the link to come back |
See PDF documents, Stock, Connections and Limits, saving and spam.
In calculations#
Calculations read answers with the same braces, as numbers: {inputs.qty}, {checkbox.extras}, {repeat.items.price}, {date.diff.start.end} and {payment.total}. They are described in Conditions and calculations.
Adding your own#
A site's code can add groups with the kindly_forms_smartcode filter. It receives null, the group, the key and the context (form, answers, entry, page), and returns the value, or null to leave the code to Kindly:
add_filter( 'kindly_forms_smartcode', function ( $value, $group, $key, $ctx ) {
if ( 'club' !== $group ) return $value;
return 'season' === $key ? '2026 to 2027' : '';
}, 10, 4 );
See Developer reference.