Hi Marketo Community,
We have a renewal reminder program we would like to improve on:
A SFDC opportunity is created for each renewal opportunity.
The Opportunity Name relates to the contract number.
The Opportunity close date relates to the expiry of the existing contract.
We would like to better automate our renewal reminder process sending out emails 30days out, 60days out etc.
One contact might manage multiple contracts, therefore there could be multiple opportunities where this person is the primary contact for the opportunity.
Thanks in advance for any advice,
In a previous role I ran a similar program to this and we used Email Scripting within tokens to populate email copy with data from the Opportunity object. We built a batch job in SFDC that flagged the opportunity at 90, 60, 30, and 0 days, and had corresponding smart campaigns in Marketo listening for that flag to change, which would then fire off the email to the primary contact on the opportunity. I wish I had some screenshots from this project to help, but it is a pretty straightforward project.
By definition, you cannot set a trigger campaign on a date field since it does not change and there is no event you could trigger from. 2 ways to handle this:
With regards to the email content, a Velocity script token will do the job. Pay attention to a couple of risks, though:
Hi Ron, Greg
Yes- I think the daily batch is pretty straight-forward and the direction I will go in.
In terms of the email content:
-Luckily, all of these types of opportunities will have the correct contact tagged as primary contact and the opportunities are not just simply tagged to an account
-Do you perhaps have some examples of some similar velocity scripting that I could take a look at to help me out?
I have tried to script a token for this (the first time I've tried this.) It would be to print the opportunity name of the opportunity which has a close date of 30 days away. Could you perhaps let me know what I am doing wrong?
#set( $defaultTimeZone = $ate.getTimeZone().getTimeZone("Europe/London") )
#set( $defaultLocale = $date.getLocale() )
#set( $calNow = $date.getCalendar() )
#set( $calConst = $field.in($calNow) )
## determine date 30 days from now
#set ($thirtyDaysAwayDate =$date.getFullYear()+($date.getMonth()+1)+$date.getDate()
##print date 30 days from now
#if( $OpportunityList && !$OpportunityList.isEmpty() )
#foreach( $opty in $sorter.sort($OpportunityList, "CloseDate") )
#if( $opty["CloseDate"] == $thirtyDaysAwayDate )
#set($myOpportunityName = $opty["Name"])
 There's a typo in the first line. You have
#set( $defaultTimeZone = $date.getTimeZone().getTimeZone("Europe/London") )
 After you add 30 days to $calNow, you don't want to then output the original $date!
Also, you don't need to output individual date components,
#set( $thirtyDaysAwayDate =$date.getFullYear()+($date.getMonth()+1)+$date.getDate() )
#set( $thirtyDaysAwayDate = $date.format("yyyyMMdd",$calNow) )
 You're expecting the CloseDate to be stored as a yyyyMMdd string. Is that actually how it's stored on your objects? It should be yyyy-MM-dd in standard Date fields.
 Not sure why you're sorting the list. I know what the effect/benefit of sorting might be, but can you tell me exactly why you're sorting before doing the match?