Send messages in users' timezones
UpdatedCustomer.io aims to help you send the right messages at the right time to your users. Two critical parts of this are sending messages in a given person’s time zone and localizing time in emails. Here, we’ll explain how to do both.
1. Create a timezone
attribute
To send campaigns and newsletters in each customer’s timezone, you’ll need to save an attribute named timezone
on your users’ profiles. A couple things to note:
- This attribute name is case sensitive (i.e., you must use
timezone
instead ofTimezone
). - The person’s
timezone
value must be in the Regional Format, so something likeCanada/Pacific
will work, but(GMT-08:00) Pacific Time (US & Canada)
will not.
You could assign the attribute using our Data Pipelines Javascript library:
analytics.identify('person@customer.io', {
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
})
2. Test your timezone
attribute
Go to Workspace Settings > Advanced: Time Zone Match.
Test that you’ve sent us the timezone
attribute in the right format. This is what tests look like, both unsuccessful and successful:
3. Use your timezone
attribute
Campaigns: set time windows to a user’s timezone
Time zone match is available when using a “Time Window” delay in your workflows:
With this setting, you can tell Customer.io to wait until a given time in a customer’s time zone before taking the next action.
You must also set a fallback here, telling Customer.io which timezone to use if a customer doesn’t have the timezone
attribute.
Send newsletters in your user’s timezone
When you create a newsletter, you can schedule delivery in the Review step:
When you select this, you’ll be presented with the option to send in your user’s time zone:
You must also set a fallback here, telling Customer.io which timezone to use if a customer doesn’t have the timezone
attribute. If a customer has an invalid value (not empty/missing) for the timezone attribute, they will receive the newsletter during the last send date/time across all timezones.
A few things to keep in mind:
- You cannot limit send rate when you schedule a newsletter to send in user timezones.
- You cannot send in user timezones if your newsletter contains variants for A/B tests. If this is important for your company, please email product@customer.io with your use case!
Use timezone data in messages
You can also localize time in your messages. Say you want to send an appointment reminder, and you have an appointment_time
timestamp. The next thing you need to figure out is whether your message uses our legacy or latest liquid then follow the steps below.
Legacy liquid
If that appointment time is a UNIX timestamp, like 2014113600, then you can use the timezone and date filters to convert it to the customer’s timezone.
{{ customer.appointment_time | timezone: customer.timezone | date: "%H:%M %A %b %d, %Y" }}
If customer.timezone
is US/Pacific
, then the above liquid will display: 05:00 Friday Oct 28, 2033.
Latest liquid
If that appointment time is a UNIX timestamp, like 2014113600, then you can use liquid to convert it to the customer’s timezone.
{{ customer.appointment_time | date: "%H:%M %A %b %d, %Y", customer.timezone }}
If customer.timezone
is US/Pacific
, then the above liquid code will display: 05:00 Friday Oct 28, 2033.
A few more resources
For Customer.io and time zones:
- There are multiple filters for handling dates and time in liquid, depending on if your message uses legacy or latest liquid.
- Here’s a full list of time zone formats supported in Customer.io.
- Online converter for epoch and unix timestamps