We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23950
    • 78 Posts
    Hello !

    i have a form built with eForm with a subject selector (4 radio boxes) like this:
           <div id="motif"> 
              <p> 
                <input type="radio" name="motif" id="motif_trad"  value="1"  /> 
                <label for="motif_trad" >Demander un devis pour une traduction</label> 
              </p> 
              <p> 
                <input type="radio" name="motif" id="motif_formation"  value="2"  /> 
                <label for="motif_formation" >Demander un devis pour une formation en langues étrangères</label> 
              </p> 
              <p> 
                <input type="radio" name="motif" id="motif_offre"  value="3"  /> 
                <label for="motif_offre" >En savoir plus sur nos offres</label> 
              </p> 
              <p> 
                <input type="radio" name="motif" id="motif_contact"  value="4"  /> 
                <label for="motif_contact" >Autre demande</label> 
              </p> 
            </div>


    i’d like to show the subject of the request in the mail sent... i tried this but it doesn’t work:

    [+motif=`1`:then=`Devis pour traduction`:else=``+][+motif=`2`:then=`Devis pour formation`:else=``+][+motif=`3`:then=`En savoir plus sur nos offres`:else=``+][+motif=`4`:then=`Autre demande`:else=``+]


    nothing is displayed :/

    do u have an idea about how i can display the subject in the form report chunk ?

    thanks smiley
      [b]∴ MES SITES SOUS MODx
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Since the report tpl is processed and immediately used by eForm as the content of the email, it doesn’t get parsed or processed besides the merging of the placeholders (and even that is done by eForm internally, not by MODx). What gets passed from the form via POST is what you get. So you’ll need to use an eForm event and create a snippet to change the $field[’subject’] value before the mail is sent.
        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