We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37105
    • 194 Posts
    You can just use output filters in your fiarTpl using build-in hook FormItAutoResponder to generate response text based on selected option.

    For example when you use the fieldname osType in your form it would be:

    [[+osType:is=`linux`:then=`whatever html or text you want to use`]]
    [[+osType:is=`windows`:then=`whatever html or text you want to use`]]
    [[+osType:is=`macos`:then=`whatever html or text you want to use`]]
    [[+osType:is=`novatel`:then=`whatever html or text you want to use`]]


    the osType in example should be the exact value in your html form. You can even create seperate custom chunks for each os and call them instead of full html or text in then-clause.



      Codeplaza Webdesign: for professional websites at low cost
      • 42503
      • 120 Posts
      Hi DonQuicky,
      My html formit code looks like this

      <select name="OS" class="menuList">
      <option>Select Operating System</option>
      <option value="Windows" [[!+fi.OS:FormItIsSelected=`Windows`]] >Windows</option>
      <option value="MacOS" [[!+fi.OS:FormItIsSelected=`MacOS`]] >Mac OS</option>
      <option value="Linux" [[!+fi.OS:FormItIsSelected=`Linux`]] >Linux</option>
      <option value="Novel" [[!+fi.OS:FormItIsSelected=`Novel`]] >Novel</option>
      </select>

      So where should I add your suggestions.

      Thank you

      Pronab

      Quote from: donquicky at Jul 22, 2013, 08:16 AM
      You can just use output filters in your fiarTpl using build-in hook FormItAutoResponder to generate response text based on selected option.

      For example when you use the fieldname osType in your form it would be:

      [[+osType:is=`linux`:then=`whatever html or text you want to use`]]
      [[+osType:is=`windows`:then=`whatever html or text you want to use`]]
      [[+osType:is=`macos`:then=`whatever html or text you want to use`]]
      [[+osType:is=`novatel`:then=`whatever html or text you want to use`]]


      the osType in example should be the exact value in your html form. You can even create seperate custom chunks for each os and call them instead of full html or text in then-clause.



        • 42503
        • 120 Posts
        Hi DonQuicky,
        Can you please help me out of this issue.

        Thank you

        Regards,
        Pronab
        Quote from: pronab.saha at Jul 22, 2013, 10:26 PM
        Hi DonQuicky,
        My html formit code looks like this

        <select name="OS" class="menuList">
        <option>Select Operating System</option>
        <option value="Windows" [[!+fi.os:formitisselected="`Windows`]]">Windows</option>
        <option value="MacOS" [[!+fi.os:formitisselected="`MacOS`]]">Mac OS</option>
        <option value="Linux" [[!+fi.os:formitisselected="`Linux`]]">Linux</option>
        <option value="Novel" [[!+fi.os:formitisselected="`Novel`]]">Novel</option>
        </select>

        So where should I add your suggestions.

        Thank you

        Pronab

        Quote from: donquicky at Jul 22, 2013, 08:16 AM
        You can just use output filters in your fiarTpl using build-in hook FormItAutoResponder to generate response text based on selected option.

        For example when you use the fieldname osType in your form it would be:

        [[+osType:is=`linux`:then=`whatever html or text you want to use`]]
        [[+osType:is=`windows`:then=`whatever html or text you want to use`]]
        [[+osType:is=`macos`:then=`whatever html or text you want to use`]]
        [[+osType:is=`novatel`:then=`whatever html or text you want to use`]]


        the osType in example should be the exact value in your html form. You can even create seperate custom chunks for each os and call them instead of full html or text in then-clause.



        • discuss.answer
          • 37105
          • 194 Posts
          Let's assume you will use separate templates [chunks] for each OS and let's assume these will be tplLinux, tplWindows, tplMacOS and tplNovatel. You have to create 4 chunks named as mentioned and put your html for the email template in it.

          Create a seperate chunk for the template call for &fiarTpl en put the next code in it:
          [[+osType:is=`linux`:then=`[[$tplLinux`]]
          [[+osType:is=`windows`:then=`[[$tplWindows`]]
          [[+osType:is=`macos`:then=`[[$tplMacOS]]`]]
          [[+osType:is=`novatel`:then=`[[$tplNovatel`]]

          Call it for example tplSelectOS so the call in FormIt would be
          &fiarTpl=`tplSelectOS`

            Codeplaza Webdesign: for professional websites at low cost
            • 42503
            • 120 Posts
            Hi Donquicky,

            First thanks for you help.

            There is some issue still it is not working,

            I have followed your steps, now what is happening formit is triggering the auto response but in the email it is giving this code.
            [[+osType:is=`linux`:then=`[[$tplLinux`]]
            [[+osType:is=`windows`:then=`[[$tplWindows`]]
            [[+osType:is=`macos`:then=`[[$tplMacOS]]`]]
            [[+osType:is=`novatel`:then=`[[$tplNovatel`]]


            Can you please tell me if I am making any mistake.

            Steps
            My formit call

            [[!FormIt?
            &hooks=`recaptcha,spam,FormSave,email,redirect,FormItAutoResponder`
            &emailTpl=`trial_report` 
            &emailSubject=`Trial Form - [[+name]]` 
            &emailTo=`[email protected]`
            &redirectTo=`91`
            &fsFormTopic=`contact`
            &recaptchaTheme=`white`
            &fiarTpl=`tplSelectOS`
            &fiarSubject=`Thank You for Contacting Us`
            &fiarToField=`email`
            &fiarFromName=`Learn MODx Website`
            ]]


            Created 4 chunks tplLinux, tplWindows, tplMacOS and tplNovatel and created the fiarTpl chunk and paste the code there
            [[+osType:is=`linux`:then=`[[$tplLinux`]]
            [[+osType:is=`windows`:then=`[[$tplWindows`]]
            [[+osType:is=`macos`:then=`[[$tplMacOS]]`]]
            [[+osType:is=`novatel`:then=`[[$tplNovatel`]]


            Couldn't understand where I am going wrong.

            Please help.

            Thank you

            Regards,
            Pronab



            Quote from: donquicky at Jul 23, 2013, 04:45 AM
            Let's assume you will use separate templates [chunks] for each OS and let's assume these will be tplLinux, tplWindows, tplMacOS and tplNovatel. You have to create 4 chunks named as mentioned and put your html for the email template in it.

            Create a seperate chunk for the template call for &fiarTpl en put the next code in it:
            [[+osType:is=`linux`:then=`[[$tplLinux`]]
            [[+osType:is=`windows`:then=`[[$tplWindows`]]
            [[+osType:is=`macos`:then=`[[$tplMacOS]]`]]
            [[+osType:is=`novatel`:then=`[[$tplNovatel`]]

            Call it for example tplSelectOS so the call in FormIt would be
            &fiarTpl=`tplSelectOS`

              • 37105
              • 194 Posts
              Ah, I see some missing characters:

              [[+osType:is=`linux`:then=`[[$tplLinux]]`]]
              [[+osType:is=`windows`:then=`[[$tplWindows]]`]]
              [[+osType:is=`macos`:then=`[[$tplMacOS]]`]]
              [[+osType:is=`novatel`:then=`[[$tplNovatel]]`]]
                Codeplaza Webdesign: for professional websites at low cost
                • 42503
                • 120 Posts
                Now it is pulling the content but like this

                [[+osType:is=`linux`:then=`this is for linux`]] [[+osType:is=`windows`:then=`This is for windows`]] [[+osType:is=`macos`:then=`This is for Mac OS.`]] [[+osType:is=`novatel`:then=`This is for Novel`]]

                Should I change the +osType to +OS. As my select box named as OS
                Quote from: donquicky at Jul 23, 2013, 05:58 AM
                Ah, I see some missing characters:

                [[+osType:is=`linux`:then=`[[$tplLinux]]`]]
                [[+osType:is=`windows`:then=`[[$tplWindows]]`]]
                [[+osType:is=`macos`:then=`[[$tplMacOS]]`]]
                [[+osType:is=`novatel`:then=`[[$tplNovatel]]`]]
                  • 37105
                  • 194 Posts
                  Yep, osType was an example smiley In your case it should be +OS
                    Codeplaza Webdesign: for professional websites at low cost
                    • 42503
                    • 120 Posts
                    Still the problem remains same. Changed the +osType to + OS. Please help.

                    Quote from: donquicky at Jul 23, 2013, 06:29 AM
                    Yep, osType was an example smiley In your case it should be +OS
                      • 37105
                      • 194 Posts
                      Your values of the select options are with starting capitals. Change the code in tplSelectOS like:
                      [[+OS:is=`Linux`:then=`[[$tplLinux]]`]]
                      [[+OS:is=`Windows`:then=`[[$tplWindows]]`]]
                      [[+OS:is=`MacOS`:then=`[[$tplMacOS]]`]]
                      [[+OS:is=`Novatel`:then=`[[$tplNovatel]]`]]
                        Codeplaza Webdesign: for professional websites at low cost