You can dynamically display a customer's nearest store in their emails using a custom field from their profile.
To set this up, get in touch with your Customer Success Representative to discuss commercials and enablement.
Store information spreadsheet
We'll need you to create a spreadsheet with all of your store information.
The spreadsheet should have:
- one row per store
- a column matching the values in your custom field, e.g.
store_id
- columns for any other data to be displayed (e.g. name, address, image, contact info, opening hours, etc.)
Send the completed spreadsheet to your Customer Success Representative.
Example:
Store_ID | Store Name | Address | Postcode | Phone Number | Email Address | Image URL |
0001 | Store A | 1 Street, Town | P05T C0D3-1 | 11111111111 | this01@that.com | https://image01.com |
0002 | Store B | 2 Street, Town | P05T C0D3-2 | 22222222222 | this02@that.com | https://image02.com |
0003 | Store C | 3, Street Town | P05T C0D3-3 | 333333333 | this03@that.com | https://image03.com |
How it works
Once we have the spreadsheet, the Creative Team build Jinja logic in your template to match the store from the customer’s profile and display the content based on that.
Here’s a simplified example:
{% if profile.properties.store_id == '0001' %}
<!-- Store A content -->
{% elif profile.properties.store_id == '0002' %}
<!-- Store B content →
{% elif profile.properties.store_id == '0003' %}
<!-- Store C content -->
{% else %}
<!-- Fallback content -->
{% endif %}
The store block can be customised with your preferred store details, e.g. image, address, opening hours etc.
Make sure to include all these details in your spreadsheet.
Fallback option
It’s important to include a fallback for any customers who don’t have a matching store code in their profile.
This can be a simple “Find your nearest store” link pointing to your store locator page.
Making changes
Once the data is built into your template, any further updates (e.g. store hours, contact details or new stores) will need to be manually added to the code by our Creative Team.
Updating the spreadsheet won’t reflect changes in the live email.
Comments
0 comments
Article is closed for comments.