Date Comparisons in Velocity Scripting
I am currently working through a problem where I need to reference the service contract object in SFDC and pull the end date of that contract into an email in Marketo. Referencing the object is easy enough, however making sure the field is consistently populated with the correct date has proved a challenge.
A customer can have more than one service contract with varying end dates and while the smart campaign might be triggered off the correct date, that date is not reliably populated using the email script token.
Is there any way that I can incorporate some date reference logic into the scripting token to pull only the date of the service contract expiring 15 days after the current date? Something along the lines of:
#if ( Service_contract.enddate == getdate() + 15 )
Service_contract.enddate
#else
** Some Text **
#end
I've looked through the Velocity documentation and haven't been able to find anything explicitly stating how to compare dates using a dynamic date reference. Obviously the above is not syntactically correct, does anyone have any ideas how to make this work in practice?
Thanks!