Using contact fields in emails

With contact fields you add recipient data to your emails, such as the first name in the salutation or the name of the associated account manager.

What are contact fields?

Contact fields are fields you have imported with your contacts, or that have come in automatically via a webshop integration. Examples:

  • First name
  • Last name
  • Email address
  • City
  • Date of birth

Go to All contacts in the left menu and select a contact to see which fields are in your account. All fields are also listed under Settings → Manage database.

Adding extra contact fields

You can add extra fields via:

  • Manual entry: adding individual contacts.
  • CSV and Excel import: uploading large lists.
  • Webhook: importing contacts from forms or pop-ups, or syncing with your systems.
  • Webshop integration: automatically importing via WooCommerce, Shopify, Magento 2, Lightspeed, or a custom webshop.
  • Manage database: under Settings → Manage database you can create your own contact field using New field.

Adding contact fields in the editor

  1. Open an email under Drafts or in an Email automation.
  2. Type @ in the text editor. The list of available fields opens.
  3. Keep typing to filter the list; capitalization doesn't matter. If no field matches, the list disappears.
  4. Choose a field with the mouse, or use the arrow keys and Enter. The field appears as {first_name} with a purple background.

In addition to your contact fields, two fields are always available in the list: {company_name} (your company name) and {year} (the current year). In fields without a list, such as a button label, you can also type the field name between curly braces yourself, for example {first_name}. Pay close attention to the spelling: a field name that doesn't exist will appear literally in your email.

You can also use contact fields in the Sender name, the Subject, and the Preheader: type @ there as well. In the Sender email field this is not possible, as only letters, numbers, periods, underscores, and hyphens are allowed there.

What if a contact has no value?

Set a default value (fallback) for every field you use — see below. If a contact has no value and there is no default value, that contact will not receive the email. The pre-send check will warn you about this, but will not prevent the email from being sent.

Setting default values (fallback)

A default value (fallback) is the text Xendy fills in when a contact has no value for a field.

  • With a default value: the contact receives the email, with the default value in that spot.
  • Without a default value: if the contact has no value for that field, they will not receive the email. This applies to fields in the text and in links, but also in the sender name, subject line, and preheader. This way, no email goes out with a gap or a bare {first_name}.

The Pre-send Check warns you if a field in your email has no default value. You can still send the email at that point.

Here's how to set default values:

  1. Go to Brand profile in the left menu (under Design).
  2. Click the Default values tab.
  3. Find the field you want to set a default value for. Next to each field you'll see the name as used in an email, for example {first_name}.
  4. Enter a value, for example customer as the default value for the first name.
  5. Click Save.

Example: if no first name is known for email@domain.com, the salutation Dear {first_name} automatically becomes Dear customer.

Tip: click a field in the editor, such as {first_name}. You'll see which default value is set (If empty: ... or No default value), and with Edit in brand profile you'll go there directly.

Good to know

  • {company_name} and {year} always have a value, and every contact has an email address.
  • A field name that doesn't exist — for example due to a typo — will appear literally in your email. The Check will warn you about that too.
  • In a test email, Xendy does not fill in any fields: you'll see the field name, along with the red notice Because this is a test email, dynamic fields have not been replaced.
  • With Forward to individual addresses, Xendy removes an empty field with no default value so the email is still delivered. The same applies to the public page of a shared email.

Showing personalized products

With product blocks, you show contacts the most relevant products for them, directly from your webshop. Xendy determines which products appear based on the rules you set.

Adding a product block

  1. In the email editor, hover between two rows and click Insert row.
  2. Choose the Products category and insert a section, for example Deals in a grid. Within a row, you can also choose the Products block via Add item.

Selecting products

  • Add manually: choose specific products yourself.

  • Dynamic products: choose a product selection. Xendy then looks up the products at the time of sending, for example:

    • the bestsellers of the past month, the same for everyone (All customers);
    • products the contact purchased before (Per customer);
    • additions to the contact's last purchase (Upsells of purchased products).

    Use Filter products to narrow down the selection, for example to a single Product group. You can read how to create and configure a product selection in Setting up dynamic products.

Customizing the display

  • Choose the Layout: Grid, List, or Featured.
  • Set the number of Columns and Rows.
  • Choose whether to show the Product name, Price, and a Button, and whether a Badge appears on it (Discount, Custom text, or None).
  • The style and text of the product button are configured under Brand profile → Buttons & layout → Product button.

Please note: if a product block finds no products for a contact, that contact will not receive the email. Exception: when a product logic works Per customer and a contact has not purchased anything yet, the product block is omitted and the email is still sent.

Requirements

  • A connected webshop (WooCommerce, Magento 2, Shopify, Lightspeed, or custom via JSON import). Without a connection with products or orders, you will not see the product blocks.
  • Well-maintained product data: make sure every product is linked to the correct category and that upsells and cross-sells are filled in where possible.

Displaying personalized images

With personalized images you show a unique image per contact, for example a banner or discount image whose URL is stored in a contact field.

How to set it up:

  1. Add an Image block in the email editor and click Choose an image.
  2. On the right side of the window you'll find Contact field. Type @ and select the field, or type the name between curly braces, for example {banner_url}.
  3. Click Add contact field.

When sending, Xendy retrieves the image for each contact from that field. Make sure the field is filled in for your contacts with a complete, working image URL. If a contact has no value in the field and there is no default value, that contact will not receive the email.

Frequently asked questions

Only if you have set a default value for that field in Brand profile → Default values. That default value will appear in place of the first name, for example Dear customer. Without a default value, a contact without a first name will not receive the email. This applies to every personal field, except {company_name} and {year}.

In a test email, Xendy does not fill in any personal fields. You will see the field name, with the red message Because this is a test email, dynamic fields have not been replaced. at the top. When actually sending, each contact receives their own data, or the default value. If a field still appears literally in the email after sending, that field name does not exist: check the spelling.

The list of fields opens with @, not with {. Type @ in the text editor and keep typing to filter the list. For how to use fields and default values, see Using contact fields in emails above.

Joeri Ras

Written by

Joeri Ras

Founder & co-owner @ Xendy

Prefer to talk directly?

Related articles