@SanfordWhiteman
Thanks so much for your help.
I had still some issue with the code where I checked for Salutation not being blank at the top of the code and then testing it again in the male/female sections but I removed that check as your code made that not necessary and it is working in all scenarios now.
Question: are the double number signs at the end of the code where the set is used to ensure there is no white space?
Here is the final code:
##check if salutation is NOT populated with Herr or Frau, set greeting
#if( !$display.alt(["Herr","Frau",""]).contains($lead.Salutation) )
#set($greeting = "${lead.Salutation},")##
##check if the lead.Gender is male
#elseif((${lead.Gender_} == "Male") || (${lead.Gender_} == "Herr") || (${lead.Salutation} == "Herr"))
#set($greeting = "Sehr geehrter Herr ${lead.LastName},")##
##check is the lead.Gender is female
#elseif((${lead.Gender_} == "Female") || (${lead.Gender_} == "female") || (${lead.Gender_} == "weiblich") || (${lead.Salutation} == "Frau"))
#set($greeting = "Sehr geehrte Frau ${lead.LastName},")##
##otherwise, use default
#else
#set($greeting = "Sehr geehrte Damen und Herren,")##
#end
##print the greeting
${greeting}
... View more