ResourcesKnowledge Base

Delivery capping

Segmentation is undoubtedly one of the most important features in campaign creation, and Mailkit provides you with a wide range of options to segment.

Email marketing should be targeted – it's not recommended to send all the campaigns to all the recipients, but it is desirable to be able to target your campaigns only to the recipients they are relevant to.The Delivery capping function is used for this purpose.

Activation of Delivery capping

Activation of Delivery cappingDelivery capping is set in the campaign via the Delivery capping button.

After clicking the button, the Query builder appears, where you can define complex, but simple rules, that the recipient must meet in order to get the campaign. This Query builder has the same basis as the Filter recipients function, so its functionality is similar.

 

 

The 1st step of Delivery capping – recipient data

Query builder has four steps, it is not mandatory to have rules filled in all steps at the same time – individual steps can be omitted.

In the first step you can (but don't have to) create rules for segmentation based on recipient data. To create a rule, click the Add rule (to add one rule) or the Add group button (add multiple rules in one level). The total number of rules and their nesting is not limited.

Delivery capping – 1st step

TIP no.1: Comparison of text fields applies to the use of operators equal, not equal, begins with, doesn't begin with, contains, doesn't contain – all comparison of text strings is ie. CASE INSENSITIVE.

Example: A city equals "prague" finds records with the value "prague" as well as with the values "Prague", "PRAGUE" or "PrAgUe".

TIP no. 2: Comparing text fields IGNORES diacritics for the use of operators equal, not equal, begins with, doesn't begin with, contains, doesn't contain
Example 1: A city equals to "Červené Pečky" finds not only records with a value of "Červené Pečky" but also "Cervene Pecky".
Example 2: A city equals to"Cervené Pecky" finds not only records with a value of "Cervené Pecky", but also "Červené Pečky".

TIP no. 3: Comparing text fields by using operators exact match and not exact match DOESN'T IGNORE diacritics and at the same time is CASE SENSITIVE:
Example 1: A city has an exact match with "Červené Pečky" finds ONLY records with a value of "Červené Pečky".
Example 2: A city does not exactly match with "Červené Pečky" finds records with "Cervene Pecky", "červené Pečky", "ČERVENÉ PEČKY" and others, but DOESN'T find a record with a value of "Červené Pečky".

While creating filters, you can click the Verify rules button at any time to check how many recipients match the specified conditions.

Verify rules

Clicking on the Number of matching records, these recipients will be exported to CSV (once the export is completed, you will find it for download in Notifications, on the top right of the page – Notification)

You can save the created rules and then reuse them. To do this, use the Load rules (in the first step) and Save rules (in the fourth step) buttons. Rules management can be found in the menu Profile –> Queries.

The 2nd step of Delivery capping – exclude data

In the second step, you can (but do not have to) select the mailing list(s) that you want to completely exclude from the rule set in the first step. In this step, it is no longer possible to filter in the selected list(s) (select only some recipients from the list(s) to be excluded).

Delivery capping – 2nd step

The 3rd step of Delivery capping – campaign delivery data

In the third step of delivery capping, you can (but don't have to) create rules regarding the distribution of campaigns to the recipients and their interactions. 

Delivery capping – 3rd step

Start by clicking on the Add Campaign/Message button and select the campaign(s) or message(s) from the list. Only campaigns and messages from the past 1 year (365 days) are available for selection. Click the OK button.

Using the Add rule or Add group buttons, you can define activities related to campaigns/messages (campaign deliveries), for example, whether the selected campaigns/messages were sent to the recipients or not, whether the recipients opened them, or whether they clicked on one of the links.

The 4th step of Delivery capping – data sources

In the fourth step, you can narrow the selection by filtering over SQL data sources, such as the feed with orders from your e-shop, as shown in the picture below – from recipients who were filtered in the previous steps will be selected those who bought goods in the e-shop from categories starting with the numbers 23 or 24.

Delivery capping – 4th step

Start by clicking on the "Add Datasource" button and select the appropriate data source (the system will offer you SQL data sources that are stored in your account). The system analyzes the selected data source. Based on this analysis it selects the field in which the email address is stored. You can adjust this selection using the drop-down menu, in which you will find all the fields identified during the data source analysis. Only fields that have been marked as a primary key or as an indexed field in the data source are available for selection. On the next line, you define whether the recipients who meet the condition of this step should be included in the selection or, on the contrary, they should be excluded from the selection. Then it is enough to define the condition itself.

Note: For a feed with orders, it is always necessary to keep in mind that the unique records in the feed are order items - ie. if there is an order that contains 3 items (different products), 3 records will be represented in the feed, with the same email address, delivery address and other data, but the items will differ eg. in product ID, product category, its quantity, price, etc.

Applying delivery capping rules

After completing 4th step, you can save the created rules for use in other filters. To activate delivery capping, click the "Use Filter" button. To confirm that the delivery capping feature is used, a green check mark appears next to the Delivery capping button: Delivery capping - applied

How to work with dates

Targeting recipients who purchased the goods 7 days ago? Or targeting those whose contract ends in 2 months? Or selecting those who have birthday today? You can do anything...

When creating rules, you can work with dates stored, for example, in the recipient's custom fields, it is possible to use system dates such as the date added, date of last message sent, consent date, etc.

The following operators can be used when working with dates: equal, not equal, greater, greater or equal, less, less or equal, is empty, is not empty.

Simple comparison

The date value to be compared must always be entered in the default MYSQL format, i.e. Y/m/d (2020/02/16).

Example 1: Simple comparison of a date field with a specific date:
Simple comparison of a date field with a specific date

Field Operator Value/expression
change_date equal 2019/08/01

Comparison using expressions

You must always enter the expression by enclosing the value in square brackets: [DB_field_format; field_function | expression; expression_function]

Each time the expression is used, the following must be filled in:

  • DB field format, that you compare with (for date type field enter "date", for text field containing date enter the format in which the date is stored, see supported formats)
  • expression - see supported expressions

Example 2: Comparison a date field with an expression:
Comparison a date field with an expression

Field Operator Value/expression Note
change_date greater_or_equal [datetime|CURDATE-7] Date of last change (change_date) is greater than or equal to the current date minus 7 days (7 days before today) and change_date field is of type datetime.

When filtering over a field in text format, you must specify the format in which the date is stored in the field.

Supported formats:

Format name Field type use Format Example
datetime date updated,
date added, date of last message sent, consent date
MySQL datetime Saved in a datetime field type formated as 2018/12/31 23:59:59
date_us custom field Y-m-d 2018-12-31
date_us_short custom field y-m-d 18-12-31
date_us_md custom field m-d 12-31
date_eu custom field d.m.Y 31.12.2018
date_eu_short custom field d.m.y 31.12.18
date_eu_dm custom field d.m. 31.12.

Supported expressions:

Expression Use Meaning
CURDATE [date|CURDATE+X] Current date + X days
  [date_us|CURDATE-X] Current date - X days
  [date_eu|CURDATE-X] Current date - X days
  [date_eu_short|CURDATE+X] Current date + X days

Example 3: Comparison a text type field with an expression:

Field Operator Value/expression Note
custom_2 greater_or_equal [date_eu|CURDATE-7] Custom field nr. 2 (custom_2)  is greater than or equal to the current date minus 7 days. Custom_2 is a text field with a date saved in the “date_eu” format  – "d.m.Y" (eg 31.12.2018).

Comparison using functions

Functions can be used for a database field, as well as for a comparison value. Therefore, you must always specify the function on the left and / or right side separately.

[DB_field_format;field_function|expression;expression_function]

Supported functions

Function Meaning
YEAR Year
MONTH Month
WEEK Week
DAY Day (1-31)
DAYOFWEEK Day of week
ANNIVERSARY Anniversary – compares the day and month of a given date regardless of the year.
AGE Age
DATE Date – rounds the date and time to whole days, ie without the time component.

Example 4: Using functions:

Field Operator Value/expression Note
s_last_sent not_equal [datetime;DATE|CURDATE] The date of last message sent (s_last_sent) is a datetime field. This filter excludes all recipients to whom something has already been sent today.
custom_1 equal [date_eu;DAYOFWEEK|CURDATE;DAYOFWEEK] Custom field 1 (custom_1) is a text field with the date stored in d.m.Y format. Day of week in custom_1 equals to the current day of the week.
custom_2 equal [date_eu;MONTH|12] Custom field 2 (custom_2) is a text field with the date stored in the d.m.Y format. This filter selects all December dates in the custom_2 field.
custom_3 equal [date_us;ANNIVERSARY|CURDATE;ANNIVERSARY] Custom field 3 (custom_3) is a text field with the recipient's date of birth stored in Y-m-d format. This filter selects all recipients who have a birthday today.
custom_4 equal [date_eu_dm;ANNIVERSARY|CURDATE+1;ANNIVERSARY] Custom field 4 (custom_4) is a text field with the recipient's date of birth stored in d.m. format. This filter selects all recipients who have a birthday tomorrow.
custom_5 equal [date_eu_dm;ANNIVERSARY|2015/12/24;ANNIVERSARY] Custom field 5 (custom_5) is a text field with the recipient's date of birth stored in d.m. format. This filter selects all recipients who have a birthday for Christmas.
custom_6 greater_or_equal [date_us;AGE|18] Custom field 6 (custom_6) is a text field with the recipient's date of birth stored in Y-m-d format. This filter selects all adult (18 years old or older) recipients.