MarTechFriday

Whitespaces and Email Salutation Tokens Scripts - #MarTechFriday 2018-33

1,696 views
Different combinations of not having a stored value for MiddleName and/or Salutation can lead to unwanted extra whitespaces in your email opening. You can address this with formula field tokens or velocity email scripting.

This video has some @Marketo related topics, but could also apply to other marketing automation platforms.

[[German example]]
#if ( ${lead.LastName} ne "" && ${lead.Salutation} eq "Herr" )
Sehr geehrter ${lead.Salutation} ${lead.LastName},
#elseif ( ${lead.LastName} ne "" && ${lead.Salutation} eq "Frau" )
Sehr geehrte ${lead.Salutation} ${lead.LastName},
#else
Sehr geehrte Damen und Herren,
#end

[[English Example]]
#if ( ${lead.Salutation} ne "" && ${lead.MiddleName} ne "" && ${lead.LastName} ne "" )
Dear ${lead.Salutation} ${lead.MiddleName} ${lead.LastName},
#elseif ( ${lead.Salutation} eq "" && ${lead.MiddleName} ne "" && ${lead.LastName} ne "" )
Dear Sir or Madam ${lead.MiddleName} ${lead.LastName},
#elseif ( ${lead.Salutation} ne "" && ${lead.MiddleName} eq "" && ${lead.LastName} ne "" )
Dear ${lead.Salutation} ${lead.LastName},
#elseif ( ${lead.Salutation} eq "" && ${lead.MiddleName} eq "" && ${lead.LastName} ne "" )
Dear Sir or Madam ${lead.LastName},
#elseif ( ${lead.Salutation} eq "" && ${lead.MiddleName} eq "" && ${lead.LastName} eq "" )
Dear Sir or Madam,
#elseif ( ${lead.Salutation} eq "" && ${lead.MiddleName} ne "" && ${lead.LastName} eq "" )
Dear Sir or Madam,
#elseif ( ${lead.Salutation} ne "" && ${lead.MiddleName} eq "" && ${lead.LastName} eq "" )
Dear ${lead.Salutation},
#else
Dear Sir or Madam,
#end