I have created a landing page via cloud pages in web studio,
The below HTML code I have added in the email to redirect to the appropriate cloud page.
The use case is that if the date is expired ,it should redirect to the fallback link. The below code is mentioned in the email html block:
<p> <a href="%%=RedirectTo(CloudPagesURL(369, 'ExpirationDate', '2019-11-03', 'Destination', 'https://fe8d1372776d05797c.pub.s7.sfmc-content.com/bmkthfudxk1','Fallback','https://fe8d1372776d05797c.pub.s7.sfmc-content.com/ljvcyngy20r'))=%%" alias="Link to somewhere"> Take me there </a> </p>
I have mentioned the below code as it is in the landing page html block:
%%[ SET @FormattedExpirationDate = Format(@ExpirationDate, "yyyy-MM-dd") SET @Today = Format(Now(), "yyyy-MM-dd") IF (DateDiff(@FormattedExpirationDate,@Today,'D')<0) THEN Redirect(@Destination) ELSE Redirect(@Fallback) ENDIF ]%%
but it is not working.
I have also tried the below code in landing page html block:
Still not working.
Also in addition to this, I have to configure the expiration date, not as a static one but a dynamic one through data extension. How can it be done?
when not using the code under landing page,the link is directed to the 1st url mentioned.
I want that to be redirected to another link once the date has been expired.
This to be done first via static way by mentioning the date, and second via dynamic way (using Data extension)