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











up vote
0
down vote

favorite












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 specifically as I have other titles that follow the same rule.



It appears that the regex {{var|$|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.,,,,,,,,,,,,









share|improve this question


























    up vote
    0
    down vote

    favorite












    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 specifically as I have other titles that follow the same rule.



    It appears that the regex {{var|$|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.,,,,,,,,,,,,









    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      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 specifically as I have other titles that follow the same rule.



      It appears that the regex {{var|$|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.,,,,,,,,,,,,









      share|improve this question













      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 specifically as I have other titles that follow the same rule.



      It appears that the regex {{var|$|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.,,,,,,,,,,,,






      thunderbird






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 30 at 23:14









      gone

      282111




      282111






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote



          accepted










          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.






          share|improve this answer





















          • Note that you can use string literals, variables, or combinations of these, as the 'if', 'then', and 'else' parameters.
            – gone
            Dec 6 at 2:03










          • It may also be possible to perform indirection on 'var' if you construct 'var' from variables and text, but I haven't tried this.
            – gone
            Dec 6 at 2:03











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "89"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1097543%2fthunderbird-mail-merge-conditional-on-field-ending-with-a-period-produces-wrong%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote



          accepted










          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.






          share|improve this answer





















          • Note that you can use string literals, variables, or combinations of these, as the 'if', 'then', and 'else' parameters.
            – gone
            Dec 6 at 2:03










          • It may also be possible to perform indirection on 'var' if you construct 'var' from variables and text, but I haven't tried this.
            – gone
            Dec 6 at 2:03















          up vote
          0
          down vote



          accepted










          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.






          share|improve this answer





















          • Note that you can use string literals, variables, or combinations of these, as the 'if', 'then', and 'else' parameters.
            – gone
            Dec 6 at 2:03










          • It may also be possible to perform indirection on 'var' if you construct 'var' from variables and text, but I haven't tried this.
            – gone
            Dec 6 at 2:03













          up vote
          0
          down vote



          accepted







          up vote
          0
          down vote



          accepted






          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.






          share|improve this answer












          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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 6 at 2:03









          gone

          282111




          282111












          • Note that you can use string literals, variables, or combinations of these, as the 'if', 'then', and 'else' parameters.
            – gone
            Dec 6 at 2:03










          • It may also be possible to perform indirection on 'var' if you construct 'var' from variables and text, but I haven't tried this.
            – gone
            Dec 6 at 2:03


















          • Note that you can use string literals, variables, or combinations of these, as the 'if', 'then', and 'else' parameters.
            – gone
            Dec 6 at 2:03










          • It may also be possible to perform indirection on 'var' if you construct 'var' from variables and text, but I haven't tried this.
            – gone
            Dec 6 at 2:03
















          Note that you can use string literals, variables, or combinations of these, as the 'if', 'then', and 'else' parameters.
          – gone
          Dec 6 at 2:03




          Note that you can use string literals, variables, or combinations of these, as the 'if', 'then', and 'else' parameters.
          – gone
          Dec 6 at 2:03












          It may also be possible to perform indirection on 'var' if you construct 'var' from variables and text, but I haven't tried this.
          – gone
          Dec 6 at 2:03




          It may also be possible to perform indirection on 'var' if you construct 'var' from variables and text, but I haven't tried this.
          – gone
          Dec 6 at 2:03


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Ask Ubuntu!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1097543%2fthunderbird-mail-merge-conditional-on-field-ending-with-a-period-produces-wrong%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Ellipse (mathématiques)

          Quarter-circle Tiles

          Mont Emei