RingCentral
  • Submit a request

Velocity script Gallery

Compilations of the Velocity scripts used in Marketo.

Usage

Click Person on the right side nav of the Script token editor and find RC Churn date, ensure that it is marked check as shown in the screenshot below.

The 30 in the redbox below will be set depending on the days you need or client specification.

Sample: https://engage-ab.marketo.com/?munchkinId=075-DTB-715#/classic/EM249942A1LA1

Churn 30days

CLOSE

Usage

This script will display end date of the current month.
As of this writing the current month is March, so the script will display March 31, 2022.

Churn 30days

CLOSE

Usage

This script will display the days left depending on the date you input on the redbox below.

Note:
Date format on the redbox is YEAR-MONTH-DATE

For this script below it will display 276 Days Left

Display Days left

CLOSE

Usage

Choose the specified current date format that you need.
$date
$date.long
$date.medium_time
$date.full_date
$date.get('default','short')
$date.get('yy-M-d H:m:s')

Display Date Formats

CLOSE

Usage

This Velocity script encrypts test leads email address and display the encrypted email address when use.

Example:

Test lead : [email protected]
Encrypted: aW5mb0BkaWFtYW50ZWxlYXNpbmcuY29t

Note:
You can check the encrypted email address if match on the actual email address in this link

Display encrypted email address

CLOSE

Usage

Click Person on the right side nav then find First Name and ensure that it is marked check as shown in the screenshot below.

Example:

Test lead : [email protected]
Display: Carlito

Capitalize First letter

CLOSE

Usage

Display date format with ordinal indicators "st", "nd", "rd" and "th"

Example:

Today is Wednesday, April 6
Display: Today is Wednesday, April 6th

Ordinal Indicators

CLOSE

Usage

Display if it's bussiness day

Example:

Today is Wednesday
Display: It's a work day!

Bussiness Days

CLOSE

Usage

Display if it's bussiness day

Note here that 8,0,0 and 17,0,0 are setting the hour, minute, and second respectively, in 24-hour time.
8,0,0 means 08:00:00 or 8 a.m. and 17,0,0 means 17:00:00 or 5 p.m.

Example:

Display: It's during business hours!

Bussiness Hours

CLOSE

Usage

Display timed promo active

This velocity script will determine whether a promo is active up to a certain from/to date

Example:

Display: The promo is active!

Display timed promo active

CLOSE

Usage

Display how long will the promo last

This velocity script will determine when the exact promo last

Example:

Display: The promo ends in , ends today! or already ended!

Display promo last

CLOSE

Usage

Populate CSM name and CSM email address, otherwise, if CSM name field contains CSS-E, CSS-M or CSRT, then populate "Your customer success team" for the name and use the CSM email field for that record. If BLANK, then do not include certain content block content block

Example:

Email: https://engage-ab.marketo.com/?munchkinId=075-DTB-715#/classic/EM400186A1LA1

CSM CSS-E CSS-M CSRT

CLOSE

Usage

You can restrict company name length

Example:

Email: https://engage-ab.marketo.com/?munchkinId=075-DTB-715#/classic/EM418333A1LA1

Company name restriction

CLOSE

Usage

Date format and eliminating hours seconds and milliseconds using RC SignUp Date field object

Date format result: DD/MM/YYYY

Date Format

CLOSE

Usage

Dynamically added/insert SiftRock "updates" using Contact owner email field object.

If the Contact owner email is EMPTY, [email protected] as the default value

Before: [email protected]

After: johneric@updates.ringcentral.com

from/reply to address

CLOSE

Usage

Dynamically added SiftRock "updates.ringcentral.com" using Sales Owner name + Sales Owner last name field

If the sales owner name + sales owner last name is EMPTY, [email protected] as the default value

All spaces between the first name and last name will be eliminated and will become lowercase

See coding task: https://www.wrike.com/open.htm?id=982708088

Dynamic SiftRock

CLOSE

Usage

Dynamically added SiftRock "reply.ringcentral.com" based on the country using Marketo country and Lead owner email address field object.

If Lead owner email address field object is EMPTY, [email protected] as the default value

Dont forget to also check this field object lead owner email address

See sample email here: https://engage-ab.marketo.com/?munchkinId=075-DTB-715#/classic/EM424784A1LA1

Dynamic SiftRock

CLOSE

Usage

Dynamically added CTA link based on the country using Country field object

For this script we are using Canada as our value for Country and will needing a specific CTA link

See sample email here: https://engage-ab.marketo.com/?munchkinId=075-DTB-715#/classic/EM424876A1LA1

Dynamic CTA link

CLOSE

Usage

Dynamically added SiftRock domain "@updates.ringcentral.com" to Account Owner Name field object

If Account Owner Name field object is EMPTY, [email protected] will be the default value

Dynamic Account Owner Name domain

CLOSE

Usage

Dynamically display current year on copyright.

Used for copyright year in Marketo to reduced workload updating year in every program.

Dynamic copyright year

CLOSE

Usage

Send emails from a lead owner and populate the Event name through their specific BMID.

Used for populate the Event name to reduced creating emails per Event.

sample email:
https://engage-ab.marketo.com/?munchkinId=075-DTB-715#/classic/EM441287A1LA1

Event name

CLOSE

Usage

Display specific content based on the features click on the survey form

Used for displaying specific content depends on the result of a survey form

sample email here

Features

CLOSE

Usage

Used for displaying specific content depends on Number of DL's of a test lead

sample email here

No. of DL's

CLOSE

Usage

Used for displaying specific content depends on M-V-P ranking

sample email here

M V P

CLOSE
  • Display 30 days after RC Churn date
    #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

    content_copyCOPY helpUSAGE

  • Display end date of the current month
    #set($cal = $date.calendar)
    $cal.add(2, 1)##
    $cal.set(5, 1)##
    $cal.add(5, -1)##
    $date.format('MMMM dd, yyyy', $cal)

    content_copyCOPY helpUSAGE

  • Display day/s left of the month/year
    #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##

    content_copyCOPY helpUSAGE

  • Display current date formats
    $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

    content_copyCOPY helpUSAGE

  • Display encrypted value of the test lead's email address
    #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

    content_copyCOPY helpUSAGE

  • Display capitalized first letter of the Lead's first name
    #set ($fname = ${lead.FirstName})
    #if($fname.equals(""))
    there
    #else
    $display.capitalize($fname)
    #end

    content_copyCOPY helpUSAGE

  • Display ordinal indicator to the day like "st", "nd", "rd" and "th"
    #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
    )}

    content_copyCOPY helpUSAGE

  • Display if it is bussiness day
    #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

    content_copyCOPY helpUSAGE

  • Display if it is bussiness hours
    #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

    content_copyCOPY helpUSAGE

  • Display timed promo active
    #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

    content_copyCOPY helpUSAGE

  • Display how long will the promo last
    #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

    content_copyCOPY helpUSAGE

  • Populate CSM name and CSM email address, otherwise, if CSM name field contains CSS-E, CSS-M or CSRT, then populate "Your customer success team" for the name and use the CSM email field for that record. If BLANK, then do not include certain content block content block
    #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

    content_copyCOPY helpUSAGE

  • Company name character length restriction
    #set($companyName = ${lead.Company})
    #set($stringLength = $companyName.length())
    #if(!($stringLength >= 40))
    $companyName
    #end

    content_copyCOPY helpUSAGE

  • Date format and eliminating hours seconds and milliseconds using RC SignUp Date field object
    #set($str = $convert.parseDate(${lead.RC_Signup_Date__c}, "yyyy-MM-dd"))
    #set($string = $date.format('short',$str))
    #set($output = $string.split(' '))
    $output[0]

    content_copyCOPY helpUSAGE

  • Dynamically added/insert SiftRock "@updates" using Contact owner email field object.
    #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

    content_copyCOPY helpUSAGE

  • Dynamically added SiftRock "@updates" using Sales Owner name + Sales Owner last name field
    #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

    content_copyCOPY helpUSAGE

  • Dynamically added SiftRock "@reply" based on the country using Marketo country and Lead owner email address field object
    #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

    content_copyCOPY helpUSAGE

  • Dynamically added CTA link based on the country using Country field object
    #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

    content_copyCOPY helpUSAGE

  • Dynamically added SiftRock domain using Account Owner Name field object
    #set ( $ownername = ${lead.Account_Owner_Name__c.toLowerCase().toString().trim().replaceAll(" ","")})
    #if ( $ownername.isEmpty() )
    [email protected]
    #else
    $ownername@updates.ringcentral.com
    #end

    content_copyCOPY helpUSAGE

  • Dynamically display current Copyright year
    #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

    content_copyCOPY helpUSAGE

  • Send emails from a lead owner and populate the Event name through their specific BMID.
    #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

    content_copyCOPY helpUSAGE

  • Display specific content based on the features clicked on the survey form
    #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

    content_copyCOPY helpUSAGE

  • Display specific content based on Number of DL's
    #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

    content_copyCOPY helpUSAGE

  • Display specific content based on M-V-P ranking clicked on survey form
    #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

    content_copyCOPY helpUSAGE

  • Facebook
  • Twitter
  • LinkedIn
  • YouTube
  • Instagram
  • TikTok
  • Legal
  • Privacy
  • Cookie Notice
  • Site Map
  • Accessibility
  • Contact Us
  • Cookie Preferences
  • Do not sell or share my personal data

© RingCentral, Inc. All rights reserved.