Modules / Forms

Form: option labels in emails

Show the label of the option a visitor chose in a form email, such as "Germany", where Bricks mails the value, such as "DE".

#33 of 39 modules by votes

  • On by default
  • Needs Bricks 2.4 or newer
  • Tested with Bricks 2.4.3
Recording: someone adds a Kiln tag to a form’s email, picks Germany on the live form and sends it; in the received email, Bricks’ tag says DE and Kiln’s tag says Germany.Recorded in Bricks 2.4.3

How to use it

  1. In a Select, Radio or Checkbox field, write each option as value:label, for example DE:Germany, and tick the field's Set options as value:label.
  2. Note the ID of the field.
  3. In the form's email content, write {kiln_form_label:FIELD_ID}, with the field's ID in place of FIELD_ID. The email shows the chosen label. For checkboxes, it shows each chosen label, separated by commas.
  4. To list the whole submission with labels, write {kiln_form_all_fields}. It works like Bricks' {{all_fields}} block.

A line written as :Germany has no value, so the label serves as the value.

Where it appears in Bricks

Two tags in the dynamic data list, under the Kiln group:

  • {kiln_form_label:field_id}, listed as "Form: option label of a field (emails)".
  • {kiln_form_all_fields}, listed as "Form: all fields with option labels (emails)".

Use them in the Form element's email content, the confirmation email and the success message.

Limits

  • Only fields with value:label options show a label. For any other field, the tag shows the submitted value.
  • A submitted value that is not one of the options is shown as typed.
  • {kiln_form_all_fields} skips file, HTML and password fields and the honeypot field. It prints each field as "Label: value", one per line.
  • {kiln_form_label:field_id} is empty for a password field.
  • The output is safe in HTML emails, plain-text emails, attributes and JSON. Line breaks become spaces, and curly braces and backslashes are encoded.
  • Kiln tells the two emails apart by order: the first mail sent during a submission is the form's email, a later one is the confirmation email. If another form action sends a mail first, such as the Registration or Lost password action, the form's email follows the confirmation email's HTML setting.
  • In a webhook body the output is safe for JSON but HTML-encoded. Use Bricks' own {{field}} tokens there.
  • Bricks' own {{field}} tokens still show values.

Settings

None. Turn the module on in Bricks > Kiln (it is on by default).

Requirements

Bricks 2.4 or newer.