Question
We are sending coupon codes to new Contacts. How can I add a dynamic expiration date to my Template so the customer knows when the offer will expire?
Answer
You can do this by defining a new variable that is today's date (the day the Campaign will be deployed) and formatting it so that it appears the way you want it.
Following is an example based on today's date (09/25/2015) with the results:
Example |
%%set dateLook = "MM/dd/yyyy"%% |
%%set newDate = {{eval dateadd builtin.today [7]}}%% |
|
%%eval formatdate $dateLook $newDate%% |
|
Results |
10/02/2015 |
Here is a breakdown of the above commands:
- dateLook - New variable that defines the format for your date value.
- newDate - New variable that will be your calculated date
- eval dateadd - Command that allows you to add a certain number of days to a given date
- builtin.today - Command that pulls in today's date
- eval formatdate $dateLook $newDate - Putting everything together, this takes the newDate value and formats it to look the way that was defined by the dateLook variable.