Skip to main content

Custom fields and campaign segmentation

In this tutorial we show you how to create custom fields and how to use them to segment your subscriber list. This way you can personalize your newsletter and your email marketing campaigns with each subscriber's data. You can also send bulk emails only to the people you want.

Creating custom fields

Go to the Subscribers > Custom fields menu.

  1. Click Add.
    Custom fields list in the Subscribers menu with the Add button
  2. Fill in the field options:
    • Field type: Text, Textarea, Number, Select, Select (multiple), Checkbox, Radio buttons or Date.
    • Label: the name of the field, very useful to identify it in the future.
    • Tag name: the name we will use, for example in newsletters, to embed the field.
    • Required: whether the field must be filled in, for example if we use it in a subscription form.
    • Default value: if we want to set a default value for the field.

    New custom field form with the Default value field
  3. If you choose Select, Select (multiple) or Radio buttons, the Options section appears instead of Default value. You can find the details in the article Custom fields.
  4. Click Create Custom field.

Import subscriber list

After creating the custom fields, you can import the contacts that have these fields among their values.

  1. Go to Subscribers > Imports and click New import.
    Imports list in the Subscribers menu with the New import button
  2. Choose one of the four import options:
    • Copy & Paste
    • Upload Files (.csv,.txt)
    • Mailchimp Import
    • Hubspot Import

    In this example we choose Upload Files (.csv,.txt) and drag the file to the indicated area (or click to choose it from your computer).


    New import with the four options and Upload Files selected
  3. In Map columns, choose in Field which Mailrelay field matches each column of the file. On the right you have the Preview data to identify each column. In this example, the third column goes to the custom field Deporte.
    Map columns with the deporte column matched to the Deporte custom field
  4. In Import to groups, choose the group or tick New group and type its name.
  5. In Additional options you can tick Update data of existing subscribers. If you don't tick it, contacts that already exist are ignored. If you tick it, you choose what to do with their groups:
    • "Keep existing subscribers in their current groups and add them to the selected groups."
    • "Remove existing subscribers from their current groups and add only to the selected groups."
  6. Tick the GDPR declaration checkbox. It is mandatory: you can't import without ticking it.
  7. Click Import.

We use a file with one contact per line and the fields separated by commas, like this one:

nombre,email,deporte
Ana,ana@ejemplo.com,Golf
Luis,luis@ejemplo.com,Tenis

When it finishes, Mailrelay shows you the result: which emails were imported correctly and which were not.

Review the custom fields of a contact

To see a contact's fields, go to Subscribers > Subscribers. Each contact has the Show, Edit and Move to trash buttons.

If you click Show, you will see the value of each custom field in the Custom fields section of the subscriber page:

Subscriber page with the Custom fields section

If you click Edit, you can change the values in the Custom fields section and save them with the Update Subscriber button:

Subscriber edit page with the Custom fields section and the Update Subscriber button

Adding custom fields to the newsletter

One of the most practical uses of custom fields is to insert them in the email. You can add them to the subject or to the body of the message. In the subject you do it from Change subject > Add variables. For the body of the message:

  1. Go to Campaigns > Campaigns, create a new newsletter or edit an existing one and click Edit design.
  2. Click a text block and, in the toolbar, click Variables.
  3. At the end of the drop-down list is the Subscriber custom fields section. Click the field you want to insert (in our example, Deporte).
    Editor Variables drop-down with the Subscriber custom fields section and the Deporte field

This adds the variable {{ subscriber.custom_fields.deporte }} to the newsletter. It has three parts:

  • subscriber: it is a subscriber variable.
  • custom_fields: it is a custom field.
  • deporte: it is the field itself (its tag name).

When the email is sent, the variable will be replaced by the value of that field for each subscriber.

Segment by the value of a custom field

You can also send a newsletter only to the subscribers who meet a condition, for example, that the Deporte field is Golf. To do so:

  1. Go to Subscribers > Segmentation and click Add.
  2. In Name, type a name that helps you recognize it later, for example, Contacts who play golf.
  3. In Conditions, the conditions are organized in groups:
    • Match all or Match any "of these condition groups": whether all groups must be met or one is enough. With Add condition group you create another group.
    • Match all or Match any "of these conditions in this group": the same, for the conditions of each group. With Add condition you add another condition to the group.

    If you only have one condition, it doesn't matter which option you choose.

  4. In the first drop-down, choose the field or event. The options are grouped in Subscriber, Campaign, General activity, SMS campaign and Custom field. In our case, we choose Deporte.
  5. Choose the condition. For a text field they are these:
    • Contains: the field must contain the typed text.
    • Doesn't contain: the field must not contain that text.
    • Equal: unlike Contains, the field must be exactly equal to the text.
    • Not equal: the field must not be exactly equal.
    • Blank: the field is empty.
    • Not blank: the field has a value.
  6. Type the value, in our example Golf.
    New segment with the condition Deporte Equal Golf and the Create Segment and Create group buttons
  7. If you want to see which subscribers meet the condition before saving it, click Preview. Click Create Segment or Create group.

What is the difference? With Create group you create a group with the contacts that meet the condition at that moment. The group keeps them even if their values change later. With Create Segment you create a kind of "dynamic group". If a contact's Deporte value changes from Golf to Karate, that contact no longer belongs to the segment.

  • A segment always contains the contacts that meet the condition.
  • A group contains the contacts that met the condition when the group was created.

From then on you can use the segment in your bulk sendings. When you choose the newsletter recipients, tick the segment option and choose the one you created.

Segment contacts who didn't open the last newsletter

Another possibility is to filter the contacts who haven't opened a specific newsletter, for example, to send it to them again.

  1. Go to Subscribers > Segmentation, click Add and type the Name.
  2. In the condition drop-down, choose Subscriber didn't open campaign.
  3. In Campaign filter, choose Specific campaigns and, in Campaigns, the newsletter you want to use. You can also tick the Restricted to subscribers that received this campaign checkbox. If you choose Any campaign, the Time interval field appears.
    New segment with the condition Subscriber didn't open campaign and Specific campaigns in Campaign filter
  4. Click Create Segment or Create group.

Segments are dynamic: if a contact opens the selected newsletter, they leave the segment automatically. Groups, on the other hand, are static. Once the group or segment is created, you can choose it when sending the newsletter.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article