Day 5 Challenge Resources
A florist wants to include a discount promotion in its weekly newsletter. The discount offer will vary depending on the customer’s upcoming birthday. If the customer’s birthday is within the next 7 days, they will receive a 15% discount. If the customer’s birthday is within the next 14 days, they will receive a 10% discount. If the customer’s birthday is not within the next 14 days, they will receive a 5% discount.
To test your AMPscript code for this challenge, you can download a sample dataset available here. You may need to edit some date values if you want to display a different discount code on your email previews.
FirstName | LastName | Birthdate | |
---|---|---|---|
john.doe@abc.com | John | Doe | 1986-02-14 |
jane.doe@xyz.com | Jane | Doe | 1990-10-10 |
jim.smith@def.com | Jim | Smith | 1978-03-07 |
sara.johnson@ghi.com | Sara | Johnson | 1989-08-15 |
mike.brown@jkl.com | Mike | Brown | 1995-04-23 |
… | … | … | … |
Your email may look like the following example if you test your AMPscript with one of the sample records provided.
Hello,
To celebrate your birthday, we are offering you a special discount!
You will receive a 15% discount on your next purchase.
Happy birthday! 🎉
Best regards,
Props Flora
Crafted with 💜 by AMPscript30.
AMPScripted Smiles Ltd.
456 Data Extension Drive Suite 321, Loop City,
Variable Valley, DE 12345