Question
Email Script: Velocity and Alternating URLs in One Email Confirmation
Hello,
I'm hoping to get some developer insight related to switching a confirmation email's URL content based on day/time
with Velocity. Note, that I am not a developer-
I was referencing @Sanford's blog: https://nation.marketo.com/community/product_and_support/blog/2017/11/28/velocitips-switch-email-content-based-on-daytime
I am trying to put together a script that will use one parent engagement program confirmation email that can include a personalize webinar URL based on the date of the event. The 5 webinars are nested inside of an engagement program, where I was hoping to set the script at the parent program level and the confirmation email would also trigger from the parent engagement program.
I am getting hung up on where I would need to set the webinar dates, and URLS display the URLs? Can I set the webinar dates and URLs directly in the script token, or do I have to use separate my.tokens to set them and reference them in the script?
If the calendar date is less than Webinar 1 date
Display my webinar url 1
If the calendar date is after Webinar 1 and before Webinar 3 date
Display my webinar url 2
If the calendar date is After Webinar 2 date and before the Webinar 4 date
Display my webinar url 3
If the calendar date is After Webinar 3 date and before Webinar 5 date
Display my webinar url 4
If the calendar date is after webinar 4
Display my webinar url 5
Display my webinar url 1
If the calendar date is after Webinar 1 and before Webinar 3 date
Display my webinar url 2
If the calendar date is After Webinar 2 date and before the Webinar 4 date
Display my webinar url 3
If the calendar date is After Webinar 3 date and before Webinar 5 date
Display my webinar url 4
If the calendar date is after webinar 4
Display my webinar url 5
#set( $defaultTimeZone = $date.getTimeZone().getTimeZone("America/New_York") )
#set( $defaultLocale = $date.getLocale() )
#set( $calNow = $date.getCalendar() )
#set( $ret = $calNow.setTimeZone($defaultTimeZone) )
#set( $calConst = $field.in($calNow) )
#set( $ISO8601 = "yyyy-MM-dd'T'HH:mm:ss" )
#set( $ISO8601DateOnly = "yyyy-MM-dd" )
#if ($calNow.get($calConst.$date.getCalendar) <= {{my.webinar 1 DT}} )
#set ($mywebinardate= "{{my.webinar 1 DT}}")
#set ($mywebinarurl= "https://event.on24.com/wcc/r/2021571/16048F8C9FD8F66DE96DBE1ECEE3DFEB")
#elseif ($calNow.get($calConst.$date.getCalendar) <= {{my.webinar 2 DT}} )
#set ($mywebinardate= "{{my.webinar 2 DT}}")
#set ($mywebinarurl= "https://event.on24.com/wcc/r/2021573/51B046F601D036C3D8F47F3A80F4E779")
##print the myvalue
$mywebinardate
$mywebinarurl
#end>