Email Script | Community
Skip to main content
Level 2
September 27, 2022
Solved

Email Script

  • September 27, 2022
  • 1 reply
  • 617 views

An Agency has created this Email Script Token for us: 

 My question: What does the highlighted mean? 

 

#if ( $lead.Salutation.matches("^(?i:m)$") && !$lead.LastName.isEmpty() )

Dear Mr ${lead.LastName}##

#elseif ( $lead.Salutation.matches("^(?i:f)$") && !$lead.LastName.isEmpty() )

Dear Ms ${lead.LastName}##

#else

Dear Sir or Madam##

#end

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by bisswang

that's regular expressions

the ?i: refers to a case-insensitive comparison

the ^..$ refers to start and end of string

=> the regex will match to m / M in the first condition and f / F in the 2nd

1 reply

bisswangAdobe EmployeeAccepted solution
Adobe Employee
September 28, 2022

that's regular expressions

the ?i: refers to a case-insensitive comparison

the ^..$ refers to start and end of string

=> the regex will match to m / M in the first condition and f / F in the 2nd