Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

Funkcionalnosć toś togo sedła se pśez wótwardowańske źěła wobgranicujo, kótarež maju wašo dožywjenje pólěpšyś. Jolic nastawk waš problem njerozwězujo a cośo pšašanje stajiś, wobrośćo se na našo zgromoźeństwo pomocy, kótarež na to caka, wam na @FirefoxSupport na Twitter a /r/firefox na Reddit pomagaś.

Pomoc pśepytaś

Glědajśo se wobšudy pomocy. Njenapominajomy was nigda, telefonowy numer zawołaś, SMS pósłaś abo wósobinske informacije pśeraźiś. Pšosym dajśo suspektnu aktiwitu z pomocu nastajenja „Znjewužywanje k wěsći daś“ k wěsći.

Dalšne informacije

Mail Merge conditional on field ending with a period produces wrong result

  • 1 wótegrono
  • 1 ma toś ten problem
  • 10 naglědow
  • Slědne wótegrono wót Nap_BlownApart

more options

I am trying to make the salutation in my email conditional on whether the recipient has a Job Title or not, but it isn't working properly. The email is sent, but the salutation is always "Dear {{First Name}},", even though the {{Job Title}} later prints as 'Dr.', which ends with a period. I need to test for the period character as I have other titles that follow the same rule.

It appears that the If/Then/Else isn't working properly. Would anyone know what I'm doing wrong?


In the body of my mail, I have the following, which always ends up printing "Dear {{First Name}},":

   Dear {{{{Job Title}}|$|.|{{Job Title}} {{Last Name}}|{{First Name}}}},
   
   Print
   {{Job Title}}
   {{Last Name}}
   {{First Name}}
   End

When I change the code to the following, the Job Title prints as expected:

   Dear {{{{Job Title}}|$|.|{{Job Title}}}},
   
   Print
   {{Job Title}}
   {{Last Name}}
   {{First Name}}
   End


In my CSV file, I have the following:

   First Name,Last Name,Display Name,Nickname,Primary Email,Secondary Email,Screen Name,Work Phone,Home Phone,Fax Number,Pager Number,Mobile Number,Home Address,Home Address 2,Home City,Home State,Home ZipCode,Home Country,Work Address,Work Address 2,Work City,Work State,Work ZipCode,Work Country,Job Title,Department,Organization,Web Page 1,Web Page 2,Birth Year,Birth Month,Birth Day,Custom 1,Custom 2,Custom 3,Custom 4,Notes
   MyFirstName,MyLastName,MyFirstName MyLastName,,me@myemail.com,,,,,,,,,,,,,,,,,,,,Dr.,,,,,,,,,,,,
I am trying to make the salutation in my email conditional on whether the recipient has a Job Title or not, but it isn't working properly. The email is sent, but the salutation is always "Dear {{First Name}},", even though the {{Job Title}} later prints as 'Dr.', which ends with a period. I need to test for the period character as I have other titles that follow the same rule. It appears that the If/Then/Else isn't working properly. Would anyone know what I'm doing wrong? In the body of my mail, I have the following, which always ends up printing "Dear {{First Name}},": Dear {{{{Job Title}}|$|.|{{Job Title}} {{Last Name}}|{{First Name}}}}, Print {{Job Title}} {{Last Name}} {{First Name}} End When I change the code to the following, the Job Title prints as expected: Dear {{{{Job Title}}|$|.|{{Job Title}}}}, Print {{Job Title}} {{Last Name}} {{First Name}} End In my CSV file, I have the following: First Name,Last Name,Display Name,Nickname,Primary Email,Secondary Email,Screen Name,Work Phone,Home Phone,Fax Number,Pager Number,Mobile Number,Home Address,Home Address 2,Home City,Home State,Home ZipCode,Home Country,Work Address,Work Address 2,Work City,Work State,Work ZipCode,Work Country,Job Title,Department,Organization,Web Page 1,Web Page 2,Birth Year,Birth Month,Birth Day,Custom 1,Custom 2,Custom 3,Custom 4,Notes MyFirstName,MyLastName,MyFirstName MyLastName,,me@myemail.com,,,,,,,,,,,,,,,,,,,,Dr.,,,,,,,,,,,,

Wót Nap_BlownApart změnjony

Wubrane rozwězanje

Alexander, the developer of the Mail Merge addon, contacted me about this problem and explained what I had done wrong. Here is a summary, in my words, that should assist others with the same problem.

You have a syntax issue based on a misunderstanding of the documentation.

The conditional syntax is actually an extension of how variables are represented, rather than a separate construct. Therefore, the statement should be:

Dear {{Job Title|$|.|{{Job Title}} {{Last Name}}|{{First Name}}}},

Notice the lack of curly brackets around the first `Job Title`.

Toś to wótegrono w konteksće cytaś 👍 0

Wšykne wótegrona (1)

more options

Wubrane rozwězanje

Alexander, the developer of the Mail Merge addon, contacted me about this problem and explained what I had done wrong. Here is a summary, in my words, that should assist others with the same problem.

You have a syntax issue based on a misunderstanding of the documentation.

The conditional syntax is actually an extension of how variables are represented, rather than a separate construct. Therefore, the statement should be:

Dear {{Job Title|$|.|{{Job Title}} {{Last Name}}|{{First Name}}}},

Notice the lack of curly brackets around the first `Job Title`.