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.
Delivery 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.
Query builder has two steps, it is not mandatory to have rules filled in both 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.
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 to "prague" finds records with the value "prague" as well as with the values "prague", "prague" or "prague"A city equals "prague" finds records with the value "prague" and 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 "Cervené 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 that has an exact match with "Červené Pečky" finds ONLY records with a value of "Červené Pečky".
Example 2: A city that 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 your filters, you can review the number of recipients that match the conditions you specify at any time by clicking 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 – )
Created rules can be saved and then reused. Just use the Load rules/Save rules buttons. You can manage all your stored rules in the Profile/Queries menu.
In the second step of delivery capping you can, but do not have to, create rules regarding the distribution of campaigns to the recipients and their interactions. For example, you can create a condition to send a campaign to those recipients who have received, opened but not clicked in another campaign.
Start by clicking on the Add Campaign/Message button and select the campaign or message from the list. Only campaigns and messages from the past 1 year (365 days) are available for selection. Click the OK button.
Then click on Add rule and define whether the selected campaigns/messages were sent to the given recipients or not. You can also define a time limit for sending.
After clicking on Add group you can determine whether the recipient clicked, opened, converted, etc. in the selected campaigns/messages.
Regardless of whether you have completed the rules in both the conditional delivery capping steps or only one, save and activate this setting by clicking the Use Filter button. A green check mark appears next to the Delivery capping button to confirm that the rules have been set:
Targeting recipients who ordered 7 days ago? Or target those whose contract will expire in 2 months? Or selecting those who have a birthday today? You can do almost anything...
When creating rules you can work with dates stored in any of the recipient's custom fields or system dates like 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.
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:
Field | Operator | Value/expression |
---|---|---|
change_date | equal | 2019/08/01 |
To specify an expression, enclose the value in square brackets: [DB_field_format; field_function | expression; expression_function]
Each time the expression is used, it shall be completed at least:
Example 2: 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..
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. |
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). |
Functions can be used for a database field, as well as for a comparison value. Therefore, we must always specify the function on the left and / or right side separately.
[DB_field_format;field_function|expression;expression_function]
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. |