Hi,
I am working on velocity scripting where I wanted to achieve particular Serial number from custom object and incase of multiple objects I wanted to keep the warranty extension end date value = 3. I am using below code to achieve this one. I am very new to velocity scripting so please suggest.
Also, you have any docs on Velocity scripting from where I can learn from basic then it would be much helpful.
#foreach($prod in $productActivityList)
#set($prodLOB = $prod.productLOB)
#set($prodCD = $prod.prodActivityCD)
##Calculate Warranty Date
#set( $warrantyEndDate = $convert.toCalendar(
$convert.parseDate(
$prod.warrantyExtensionEndDate,
$ISO8601DateOnly,
$defaultLocale,
$inTimeZone
)
) )
#set( $diffRemaining = $date.difference($calNow,$warrantyEndDate) )
#set( $daysRemaining = $convert.toInteger($diffRemaining.getDays()) )
#if( $daysRemaining == 3 && $eligibleProdList.contains($prodLOB) && $eligibleCDList.contains($prodCD) && !$prod.warrantyExtensionEndDate )
#set($yourMachine = $prod.productBrand)
#set ($serialNo = $productActivityList.get(0).productSerial)
<a href="https://test?upgrade&sn=${serialNo}&source=APOSMAIL&groupId={{lead.storeCodeAffinity}}&CID={{my.CID-Email 02-US}}&rrid={{lead.Midas Contact ID}}">
<img src="#" alt="Extend Your Warranty">
</a>
#end
#end
... View more