Challenge
https://ampscript30.com/ampscript-challenge-day7/
To calculate the renewal date from today’s date based on different payment plans.
Solution
%%[
SET @PaymentFrequency = PaymentFrequency
SET @EmailSentTime = Now()
IF @PaymentFrequency == 'Annual' THEN
SET @expiry = FormatDate(DateAdd(@EmailSentTime, '1', 'Y'), 'MMMM DD, YYYY')
ELSE
SET @expiry = FormatDate(DateAdd(@EmailSentTime, '1', 'M'), 'MMMM DD, YYYY')
ENDIF
]%%
Thank you for your payment of %%PaymentAmount%% for your %%PaymentFrequency%% subscription plan. Your subscription will expire on %%=v(@expiry)=%%.

Preview

Summary
For Now() function, if (1) is used, after an email is sent, it will preserve the send time instead of the current system time; if it’s for a triggered send, it will preserve the time when the triggered send job is published.
