We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22640
    • 44 Posts
    Hi everyone,

    I’ve looked everywhere but cannot find an answer sad

    Can you send one of two ’Thank You’ emails conditional on an answer to one of the questions? For example, if the user choose A from a dropdown, then they get ’Thank You Email A.’ And then, obviously, if they choose B, they get ’Thank You Email B.’ Is this possible?

    Any help would be great!!

    If this cannot be done, how can I go about putting conditionals in my Thank You Email template?

    cheers,
    Glenn
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      There are two different tpls, the "thankyou" tpl is used on the eForm page after a successful submission. For the email, there is the "report" tpl.

      You should be able to use a snippet/function and the eFormOnBeforeMailSent event to set the whole output you want in a placeholder in the $fields array, then while it would use the same tpl the placeholder in the tpl would be replaced according to the value you set it to be in the function. Your function would have the code to determine which value to set in the placeholder.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 22640
        • 44 Posts
        Thanks Susan, I’ll give it a try.

        Glenn