Birthday And Nameday Emails
Birthday
Set up the birthday campaign
You may want to contact your customers on their birthday and wish them all the best or offer them something special (recommendations or a discount coupon). To do this, you must have a customer attribute in the date format with the customers' birthday. After that, you can create a scenario that will send out emails on a daily basis to people whose birthday is on that day.
-
Create a new scenario, add a repeat trigger, and set it to "daily" at the desired time.
-
Create a condition that compares the current date with birth dates.
- Create a condition that checks if customers have valid consent, email, and whether 'email_invalid' is NOT true in order to reduce suppressed emails
- Create a condition that checks if customers have NOT received a birthday campaign within the last 364 days to ensure that customers would not receive more vouchers in case they change their birth dates.
-
Create a condition 'Birthday on 29th February' that checks if customers have birthday on February 29th.
-
To account for people who have their birthday on a leap year (on February 29th), create a condition named 'Is 28th February and year is NOT a leap year' that checks via Jinja if the current day and month equal February 28th and that the current year is not a leap year. This condition should be placed after the condition 'Birthday on 29th February'.
To achieve this, insert the code displayed below.
{% set current_day = (time | from_timestamp('%-d')) | int %}
{% set current_month = (time | from_timestamp('%-m')) | int %}
{% set is_leap_year = true if (((time | from_timestamp('%Y')) | int) % 4 == 0) else false %}
{% if (current_day == 28 and current_month == 2 and is_leap_year == false ) %}
True
{% elif (current_day == 29 and current_month == 2 and is_leap_year == true ) %}
False
{% endif %}
- Create an additional condition named 'Birthday on 29th February' that, in case the previous node is TRUE, checks if the customer whether a customer has a birthday falling on February 29th. If they have their birthday on February 29th, customers will receive their birthday campaign on February 28th during regular years and on February 29th during a leap year.
- Select a desired email template.
The whole scenario should look like this.
Scenario logic
If it is a leap year and a customer has their birthday on February 29th, the condition node 'Date is 28th February and year is NOT a leap year' will return 'false', and customers with a birthday on 29th February will pass the condition 'Has birthday today' on 29th February and receive email on their birthdays.
If it is not a leap year and a customer has their birthday on February 29th, the condition node ' Date is 28th February and year is NOT a leap year' will return 'true', and the customers with their birthday February 29th will receive the campaign on February 28th.
Tip
Adjust email content via display conditions to customers that have a birthday on February 29th.
Nameday
Set up the Nameday campaign
It is also possible to send customers emails on their name day, and it is possible to identify their name day based on their name from an imported catalog.
- Import a catalog with the following attributes:
- item_id - this will be a name that a customer can input when registering. Be sure to include multiple combinations of special characters/capital letters, as it needs to be a perfect match, e.g., have different ids for Martin, Martin, and MARTIN
- addressingname - this is an attribute you will use in the email, and will always be in the correct form, e.g., martin is associated with Martin
- gender (optional) - you can directly assign gender to names to have this attribute stored with the customers
- nameday - a timestamp with the correct date. This can be a date of any year
It should look similar to this:
- Create a scenario where attributes will be assigned to customers daily based on the catalog. This scenario should run before any emailing is attempted.
- Add a repeat trigger, a condition node, and three set attribute nodes
- Set the condition only for customers not having
nameday
andaddressing_name
assigned yet, butfirst_name
has value.
- For each you should set attribute node, pair the attributes with their respective fields in the catalog using also Jinja as below, where:
nameday
in catalogs.nameday.item is catalog namefirst_name
is the attribute you use for storing first name of the customernameday
in item.nameday is the attribute you have in your catalog. This will be the only thing replaced when setting attributes for gender and addressing name.
{% set item = catalogs.nameday.item_by_id(customer.first_name | trim) %}{{item.nameday }}
- Now repeat steps of creating the birthday scenario above, only replacing the
birthday
attribute with thenameday
attribute.
Updated 12 months ago