I have requirements that I have created a VF Email template and I need to add the today date and next year date dynamically, Today is working fine as mentioned in code but when I try to add year+1 It is not showing next year. Also, I need to add a randomly generated number at the place of Application no. Please have a look at my code.
<messaging:emailTemplate subject="Welcome" recipientType="User" relatedToType="Contact" >
<messaging:attachment renderAs="PDF" filename="Certificate.pdf">
<head>
<title></title>
</head>
<body>
<div style="width:95%;height:100%;border:15px solid #000066">
<table width="100%" style="background-color:#D3D3D3;">
<tr>
<td rowspan="1" class="slds-text-title_caps" style="text-align:left">
<img width="250px" alt="logo" src="{!$Resource.Abc}"></img>
</td>
<td rowspan="1" class="slds-text-title_caps" style="text-align:right;">
<img width="100px" alt="logo" src="{!$Resource.Members_Logo}"></img>
</td>
</tr>
</table>
<table width="100%" style="background-color:#D3D3D3">
<tr>
<th class="slds-text-title_caps" style ="text-align:center">
This Certificate valid from {!DAY(TODAY())}-{!MONTH(TODAY())}-{!YEAR(TODAY())} to {!DAY(TODAY())}-{!MONTH(TODAY())}-{!YEAR(TODAY())}
</th>
</tr>
<tr>
<th class="slds-text-title_caps" style ="text-align:center">
Application No.
</th>
</tr>
<tr>
<th class="slds-text-title_caps" style ="text-align:center">
1234567
</th>
</tr>
</table>
</div>
</body>
</html>
</messaging:attachment>
<messaging:htmlEmailBody >
+1
in your expressionThis Certificate valid from {!DAY(TODAY())}-{!MONTH(TODAY())}-{!YEAR(TODAY())} to {!DAY(TODAY())}-{!MONTH(TODAY())}-{!YEAR(TODAY())}