#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($ISO8601DateOnly ="yyyy-MM-dd")
#set($ISO8601DateTime ="yyyy-MM-dd'T'HH:mm:ss")
#set($ISO8601DateTimeWithSpace ="yyyy-MM-dd HH:mm:ss")
#set($ISO8601DateTimeWithMillisUTC ="yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
#set($ISO8601DateTimeWithMillisTZ ="yyyy-MM-dd'T'HH:mm:ss.SSSZ")
#set($churnDate = ${lead.RC_Churn_Date__c})
#if (!$churnDate || $churnDate.isEmpty())
Churn Date Field is null
#else
#set($myCalField = $convert.toCalendar($convert.parseDate($churnDate,$ISO8601DateOnly,$defaultLocale,$defaultTimeZone)))
$myCalField.add($calConst.DATE,30)##
#set($FRIENDLY_DATE_WITH_FRIENDLY_TZ ="MMM dd, yyyy z")
${date.format($FRIENDLY_DATE_WITH_FRIENDLY_TZ,$myCalField,$defaultLocale,$defaultTimeZone)}##
#end
#set($cal = $date.calendar)
$cal.add(2, 1)##
$cal.set(5, 1)##
$cal.add(5, -1)##
$date.format('MMMM dd, yyyy', $cal)
#set ($TODAY = $date.getCalendar())
#set ($DEFAULT_TIMEZONE = $date.getTimeZone().getTimeZone("America/Tijuana") )
#set ($DEFAULT_LOCAL = $date.getLocale() )
#set ($ISO8601 = "yyyy-MM-dd'T'HH:mm:ss" )
#set ($EVENT_DATE = $convert.parseDate(
'2022-12-31T00:00:00',
$ISO8601,
$DEFAULT_LOCAL,
$DEFAULT_TIMEZONE
))
#set( $DIFF = $date.difference($TODAY,$EVENT_DATE).getDays())
$convert.toString($DIFF) Days Left##
$date
##Display Mar 29, 2022 1:22:54 PM
$date.long
##Display March 29, 2022 1:22:54 PM CDT
$date.medium_time
##Display 1:22:54 PM
$date.full_date
##Display Tuesday, March 29, 2022
$date.get('default','short')
##Display Mar 29, 2022 1:22 PM
$date.get('yy-M-d H:m:s')
##Display 22-3-29 13:22:54
#macro( userlandBase64_v3 $inputString $alsoURIEncode $charset)
#set( $Base64PaddingChar = "=" )
#set( $Base64ByteChunkSize = 3 )
#set( $Base64BitGroupSize = 6 )
#set( $Base64Charsets = {
"RFC4648" : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
"RFC4648URLSafePadding" : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"
} )
#set( $Base64Charset = $display.alt($Base64Charsets[$charset],$Base64Charsets["RFC4648"]) )
#set( $uriEncode = $display.alt($alsoURIEncode, false) )
#set( $Integer = 0 )
#set( $Long = $field.in($Integer).MAX_VALUE + 1 )
#set( $BigInteger = $field.in($Long).MAX_VALUE + 1 )
#set( $String = "" )
#set( $Base64Final = [] )
#if( $uriEncode )
#set( $inputString = $esc.url($inputString) )
#end
#set( $inputBytes = $inputString.getBytes() )
#set( $inputList = [] )
#set( $void = $inputList.addAll( $inputBytes.subList(0,$inputBytes.size())) )
#set( $inputSizeB = $inputList.size() )
#set( $padding = $math.mod($inputSizeB, $Base64ByteChunkSize) )
#if( $padding > 0 )
#foreach( $pad in [1..$math.sub($Base64ByteChunkSize,$padding)] )
#set( $void = $inputList.add($null) )
#end
#end
#foreach( $byteGroup in [0..$math.sub($math.idiv($inputList.size(),$Base64ByteChunkSize),1)])
#set( $startOffset = $math.mul($byteGroup,$Base64ByteChunkSize) )
#set( $endOffset = $math.add($startOffset,$Base64ByteChunkSize) )
#set( $bytes = $inputList.subList($startOffset,$endOffset) )
#set( $integerList = [] )
#foreach( $byte in $bytes )
#if( $byte )
#set( $currentInteger = $convert.toInteger($byte) )
#set( $void = $integerList.add($convert.toInteger($BigInteger.valueOf($currentInteger).and($BigInteger.valueOf(255))) ))
#else
#set( $void = $integerList.add($null) )
#end
#end
#set( $binStrings = [] )
#foreach( $currentInteger in $integerList )
#set( $void = $binStrings.add($String.format("%8s",$Integer.toBinaryString($currentInteger)).replace(" ","0")) )
#end
#set( $allBinStrings = $display.list($binStrings,"") )
#set( $bitGroups = [] )
#foreach( $bitGroup in [0..$math.sub($math.idiv($allBinStrings.length(),$Base64BitGroupSize),1)] )
#set( $startOffset = $math.mul($bitGroup,$Base64BitGroupSize) )
#set( $endOffset = $math.add($startOffset,$Base64BitGroupSize) )
#set( $void = $bitGroups.add($allBinStrings.substring($startOffset,$endOffset)) )
#end
#foreach( $group in $bitGroups )
#if( !$group.contains("null") )
#set( $Base64CharsetPos = $Integer.parseInt($group,2) )
#set( $Base64Char = $Base64Charset.charAt($Base64CharsetPos) )
#else
#set( $Base64Char = $Base64PaddingChar )
#end
#set( $void = $Base64Final.add($Base64Char) )
#end
#end
$display.list($Base64Final,"")
#end
#set($lead.Email_Address_1 = ${lead.Email})
#set($lead.Email_Address = "${lead.Email}")
#if(!$lead.Email_Address_1 || $lead.Email_Address_1.isEmpty())
Null
#else
#userlandBase64_v3("$lead.Email_Address")
#end
#set ($fname = ${lead.FirstName})
#if($fname.equals(""))
there
#else
$display.capitalize($fname)
#end
#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( $ISO8601DateOnly = "yyyy-MM-dd" )
#set( $ISO8601DateTime = "yyyy-MM-dd'T'HH:mm:ss" )
#set( $ISO8601DateTimeWithSpace = "yyyy-MM-dd HH:mm:ss" )
#set( $ISO8601DateTimeWithMillisUTC = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" )
#set( $ISO8601DateTimeWithMillisTZ = "yyyy-MM-dd'T'HH:mm:ss.SSSZ" )
#define( $enUSDayOrdinalIndicators )
1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10th 11th 12th 13th 14th 15th 16th 17th 18th 19th 20th 21st 22nd 23rd 24th 25th 26th 27th 28th 29th 30th 31st
#end
#set( $indicatorList = $enUSDayOrdinalIndicators.toString().trim().split("\s?\d+") )
Today (is
${date.format(
"EEEE, MMMM d'${indicatorList[$calNow.get($calConst.DAY_OF_MONTH)]}'",
$calNow,
$defaultLocale,
$defaultTimeZone
)}
#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( $ISO8601DateOnly = "yyyy-MM-dd" )
#set( $ISO8601DateTime = "yyyy-MM-dd'T'HH:mm:ss" )
#set( $ISO8601DateTimeWithSpace = "yyyy-MM-dd HH:mm:ss" )
#set( $ISO8601DateTimeWithMillisUTC = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" )
#set( $ISO8601DateTimeWithMillisTZ = "yyyy-MM-dd'T'HH:mm:ss.SSSZ" )
#set( $businessDays = [
$calConst.MONDAY,
$calConst.TUESDAY,
$calConst.WEDNESDAY,
$calConst.THURSDAY,
$calConst.FRIDAY
] )
#if( $businessDays.contains($calNow.get($calConst.DAY_OF_WEEK)) )
It's a work day!
#end
#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( $ISO8601DateOnly = "yyyy-MM-dd" )
#set( $ISO8601DateTime = "yyyy-MM-dd'T'HH:mm:ss" )
#set( $ISO8601DateTimeWithSpace = "yyyy-MM-dd HH:mm:ss" )
#set( $ISO8601DateTimeWithMillisUTC = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" )
#set( $ISO8601DateTimeWithMillisTZ = "yyyy-MM-dd'T'HH:mm:ss.SSSZ" )
#set( $calStartOfBusiness = $date.getCalendar() )
#set( $ret = $calStartOfBusiness.setTimeZone($defaultTimeZone) )
#set( $ret = $calStartOfBusiness.set(
$calStartOfBusiness.get($calConst.YEAR),
$calStartOfBusiness.get($calConst.MONTH),
$calStartOfBusiness.get($calConst.DAY_OF_MONTH),
8,
0,
0
) )
#set( $ret = $calStartOfBusiness.set($calConst.MILLISECOND,0) )
#set( $calCloseOfBusiness = $date.getCalendar() )
#set( $ret = $calCloseOfBusiness.setTimeZone($defaultTimeZone) )
#set( $ret = $calCloseOfBusiness.set(
$calCloseOfBusiness.get($calConst.YEAR),
$calCloseOfBusiness.get($calConst.MONTH),
$calCloseOfBusiness.get($calConst.DAY_OF_MONTH),
17,
0,
0
) )
#set( $ret = $calCloseOfBusiness.set($calConst.MILLISECOND,0) )
#if( $calNow.compareTo($calStartOfBusiness) >= 0 && $calNow.compareTo($calCloseOfBusiness) = 0 )
It's during business hours!
#else
We are close!
#end
#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( $ISO8601DateOnly = "yyyy-MM-dd" )
#set( $ISO8601DateTime = "yyyy-MM-dd'T'HH:mm:ss" )
#set( $ISO8601DateTimeWithSpace = "yyyy-MM-dd HH:mm:ss" )
#set( $ISO8601DateTimeWithMillisUTC = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" )
#set( $ISO8601DateTimeWithMillisTZ = "yyyy-MM-dd'T'HH:mm:ss.SSSZ" )
#set( $calStartOfPromo = $convert.toCalendar(
$convert.parseDate(
"2017-11-15T00:00:00",
$ISO8601DateTime,
$defaultLocale,
$defaultTimeZone
)
) )
#set( $calEndOfPromo = $convert.toCalendar(
$convert.parseDate(
"2017-12-01T00:00:00",
$ISO8601DateTime,
$defaultLocale,
$defaultTimeZone
)
) )
#if( $calNow.compareTo($calStartOfPromo) >=0 && $calNow.before($calEndOfPromo) )
The promo is active!
#end
#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( $ISO8601DateOnly = "yyyy-MM-dd" )
#set( $ISO8601DateTime = "yyyy-MM-dd'T'HH:mm:ss" )
#set( $ISO8601DateTimeWithSpace = "yyyy-MM-dd HH:mm:ss" )
#set( $ISO8601DateTimeWithMillisUTC = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" )
#set( $ISO8601DateTimeWithMillisTZ = "yyyy-MM-dd'T'HH:mm:ss.SSSZ" )
#set( $ret = $calNow.set(
$calNow.get($calConst.YEAR),
$calNow.get($calConst.MONTH),
$calNow.get($calConst.DAY_OF_MONTH),
0,
0,
0
) )
#set( $ret = $calNow.set($calConst.MILLISECOND,0) )
#set( $calEndOfPromo = $convert.toCalendar(
$convert.parseDate(
"2018-01-22T00:00:00",
$ISO8601DateTime,
$defaultLocale,
$defaultTimeZone
)
) )
#set( $diffRemaining = $date.difference($calNow,$calEndOfPromo) )
#set( $daysRemaining = $convert.toInteger($diffRemaining.getDays()) )
#set( $weeksRemaining = $convert.toInteger($diffRemaining.getWeeks()) )
The promo
#if( $weeksRemaining > 0 )
ends in ${weeksRemaining} ${display.plural($weeksRemaining,"week","weeks")}!
#elseif( $daysRemaining > 0 )
ends in ${daysRemaining} ${display.plural($daysRemaining,"day","days")}!
#elseif( $daysRemaining == 0 )
ends today!
#else
already ended!
#end
#set($ownerName = ${lead.CSM_Name__c})
#set($ownerEmail = ${lead.CSM_Email__c})
#if($ownerName == "CSS-E" || $ownerName == "CSS-M" || $ownerName == "CSS-MM" || $ownerName == "CSRT")
*Lorem ipsum dolor sit amet consectetur adipisicing elit. Placeat culpa reprehenderit doloremque recusandae omnis atque ullam ipsa delectus, consequuntur esse deserunt assumenda suscipit quibusdam officia voluptatum illum quisquam enim quod!
#elseif(!$ownerName || $ownerName.isEmpty())
$ownerName
$ownerEmail
#else
*Lorem ipsum dolor sit, amet consectetur adipisicing elit. Quaerat autem alias sed earum deleniti distinctio eos praesentium nemo natus nam delectus magnam, ad tempora dolore doloribus, esse voluptate in nihil?
#end
#set($companyName = ${lead.Company})
#set($stringLength = $companyName.length())
#if(!($stringLength >= 40))
$companyName
#end
#set($str = $convert.parseDate(${lead.RC_Signup_Date__c}, "yyyy-MM-dd"))
#set($string = $date.format('short',$str))
#set($output = $string.split(' '))
$output[0]
#set($string = ${lead.Contact_Owner_Email__c})
#if($string.isEmpty())
[email protected]
#else
#set($output = $string.split('@'))
#set($final = "$output[0]@updates.$output[1]")
$final
#end
#set ($ownername = ${lead.Lead_Owner_First_Name.toLowerCase().toString().trim().replaceAll(" ","")})
#set ($ownerlastname = ${lead.Lead_Owner_Last_Name.toLowerCase().toString().trim().replaceAll(" ","")})
#set ($ownerfullname = "$ownername.$ownerlastname")
#if ($ownername.isEmpty() || $ownerlastname.isEmpty())
[email protected]
#else
[email protected]
#end
#set ($mktoCountry = ${lead.Marketo_Country__c})
#set ($ReplyToFrom = ${lead.Lead_Owner_Email_Address})
#set ($FinalReplyToFrom = $ReplyToFrom.split("@"))
#if(!($ReplyToFrom) || $ReplyToFrom.isEmpty())
[email protected]##
#else
#if ($mktoCountry == "Australia" || $mktoCountry == "United Kingdom" || $mktoCountry == "Austria" || $mktoCountry == "Belgium" || $mktoCountry == "Bulgaria" || $mktoCountry == "Croatia" || $mktoCountry == "Republic of Cyprus" || $mktoCountry == "Czech Republic" || $mktoCountry == "Denmark" || $mktoCountry == "Estonia" || $mktoCountry == "Finland" || $mktoCountry == "France" || $mktoCountry == "Germany" || $mktoCountry == "Greece" || $mktoCountry == "Hungary" || $mktoCountry == "Ireland" || $mktoCountry == "Italy" || $mktoCountry == "Latvia" || $mktoCountry == "Lithuania" || $mktoCountry == "Luxembourg" || $mktoCountry == "Malta" || $mktoCountry == "Netherlands" || $mktoCountry == "Poland" || $mktoCountry == "Portugal" || $mktoCountry == "Romania" || $mktoCountry == "Slovakia" || $mktoCountry == "Slovenia" || $mktoCountry == "Spain" || $mktoCountry == "Sweden")
$ReplyToFrom##
#else
$FinalReplyToFrom[0]@reply.ringcentral.com##
#end
#end
#set ($Country = ${lead.Country})
#set ($CanCTALink = "https://netstorage.ringcentral.com/guides/invoice-billing-guide-ca.pdf")
#set ($USCTALink = "https://netstorage.ringcentral.com/guides/invoice-billing-guide-us.pdf")
#if ($Country == "Canada")##
$CanCTALink##
#else
$USCTALink##
#end
#set ( $ownername = ${lead.Account_Owner_Name__c.toLowerCase().toString().trim().replaceAll(" ","")})
#if ( $ownername.isEmpty() )
[email protected]
#else
$ownername@updates.ringcentral.com
#end
#set ($country = ${lead.Timezone__c})
#if (!$country || $country.isEmpty())
IF-Timezone: $country
$date.format(
"yyyy",
$date,
$date.getLocale(),
$date.getTimeZone().getTimeZone('Australia/Canberra')
)
#else
Else-Timezone: $country
$date.format(
"yyyy",
$date,
$date.getLocale(),
$date.getTimeZone().getTimeZone(${lead.Timezone__c})
)
#end
#set($LeadBMID = ${lead.BMID__c})
#set($BMIDArray = [
{
"BMID":"DIGITALBANKINGQ22023",
"WebinarTitle":"Digital Banking"
},
{
"BMID":"CCW2023Q2",
"WebinarTitle":"CCW Las Vegas"
},
{
"BMID":"GARTNERAPAC2023Q3",
"WebinarTitle":"Gartner Symposium APAC"
},
{
"BMID":"GARTNERAMER2023Q4",
"WebinarTitle":"Gartner Symposium Americas"
},
{
"BMID":"GARTNEREMEA2023Q4",
"WebinarTitle":"Gartner Symposium EMEA"
},
{
"BMID":"UCEXPO2023Q4",
"WebinarTitle":"UCX Expo"
},
{
"BMID":"EDUCAUSE2023Q3",
"WebinarTitle":"Educase"
},
{
"BMID":"INSURETECH2023Q4",
"WebinarTitle":"InsureTech"
},
{
"BMID":"AWSREINVENT2023Q4",
"WebinarTitle":"AWS Re:Invent"
}
])##
#foreach($BMIDWebinar in $BMIDArray)
#if($BMIDWebinar.BMID == $LeadBMID)
$BMIDWebinar.WebinarTitle##
#end
#end
#set($Features = $lead.Onboarding_Survey_Response_5)
#set($CONTENTMap = {
"a": 'content here...',
"b": 'content here...',
"c": 'content here...',
"d": 'content here...',
"e": 'content here...'
})
#set($trimmedValue = $Features)
#if($trimmedValue.contains("a"))
$CONTENTMap.a
#end
#if($trimmedValue.contains("a; b"))
$CONTENTMap.b
#elseif($trimmedValue.contains("c; d"))
$CONTENTMap.b
#end
#if($trimmedValue.contains("c"))
$CONTENTMap.c
#end
#if($trimmedValue.contains("d"))
$CONTENTMap.d
#end
#set($numDLs = $lead.Number_of_DL_s__c)
#if(!($numDLs) || $numDLs.isEmpty() || ($numDLs == 1) || ($numDLs == 0) || ($numDLs == 2))
#set($result = 'content here...')
$result
#else
#set($numDLsConverted = $convert.toInteger($numDLs))
#if($numDLsConverted > 2 && $numDLsConverted = 19)
#set($result = 'content here...')
$result
#elseif($numDLsConverted >= 20)
#set($result = 'content here...')
$result
#end
#end
#set($Message = $lead.Onboarding_Survey_Response_1)
#set($Video = $lead.Onboarding_Survey_Response_2)
#set($Phone = $lead.Onboarding_Survey_Response_3)
#set($CONTENTArray = [
{
"VALUES": ["M", "Not very often", "Not very often"],
"EmailContent": 'content here...'
},
{
"VALUES": ["Not very often", "V", "Not very often"],
"EmailContent": 'content here...'
},
{
"VALUES": ["Not very often", "Not very often", "P"],
"EmailContent": 'content here...'
}
])
#set($contentDisplayed = false)
#foreach($Content in $CONTENTArray)
#if($Content.VALUES.contains($Message) && $Content.VALUES.contains($Video) && $Content.VALUES.contains($Phone))
$Content.EmailContent
#set($contentDisplayed = true)
#break
#end
#end
#if(!$contentDisplayed)
#end