Expand my Community achievements bar.

Dynamic content component date

Avatar

Level 1

Hi,

I want to add a date that is 30 days after the email is sent. So, which HTML tag or code do I need to mention in the Email template?

3 Replies

Avatar

Community Advisor

Hello @rasiksj0311

 

Please try the following code in HTML : 

<%
var currentDateMinus30 = new Date();
 currentDateMinus30.setDate(currentDateMinus30.getDate() - 30);

%>

<p><%= formatDate(currentDateMinus30, "%2D/%2M/%4Y") %> </p>

 

 

I tried this code and it is working. 

PFA Screenshot: 

Parvesh_Parmar_0-1695935344617.png

 

Kr,

Parvesh

 

Avatar

Level 1

Thanks Parvesh!

 

I tried this code and it is working on email. But when it moved on the web it shows the current date + 30 days. It should be the same on email and web versions also. Do you have any idea about this, how the date on webmail will be the same as on email?

 

I appreciate your help in advance.

Avatar

Administrator

Hi @Parvesh_Parmar,

Could you please help @rasiksj0311 further with their query?

Thanks!



Sukrity Wadhwa