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

    Working on my first modx site, I like it a lot.

    But I’ve got a question on Formit!

    I want to include the email address captured in the form in the &emailTO parameter passed to Formit

    I was hoping for something like the &emailUseFieldForSubject which would identify the email address from the form and pass it to Formit

    I can’t find any clues in the documentation, any help would be much appreciated.


    Gary

      • 3749
      • 24,544 Posts
      I’m feeling dense this morning and I’m afraid I don’t understand your question. It sounds like you want the site visitor to be able to specify the email address to send the email to in the form. That would be an open invitation to spammers.

      Can you help us understand what you’re trying to do and why?

      BTW, if you just want to use the email in the message, you can include [[+email]] in the emailTpl chunk.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 26400
        • 2 Posts
        Hi BobRay,

        The website is for a coach hire company, the form is a booking reservation form. When a potential client makes a booking, the email should be
        sent to the coach hire company (of course), but they also want to CC the email to the client as a confirmation of their booking request.

        I know about using [[+email]] in the emailTpl chunk, but I also want to get that field into the emailTo variable which is passed to Formit.

        I’m using the reCAPTCHA hook, so I’m not worried about spammers. I’m hosting & administering the website, so I can take steps if it does become a problem.
          • 3749
          • 24,544 Posts
          The only thing I can think of is to duplicate and rename the FormIt email hook and modify the code in it to send the confirmation email. Then you’d specify both the original email hook and the custom hook in the FormIt tag.

          Maybe there’s an easier way, but I can’t come up with it.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 4172
            • 5,888 Posts
            I think you can modify the emailTo-value in a hook-snippet:

            <?php
            
            $scriptProperties['hook']->formit->config['emailTo']='[email protected]';
            return true; 
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 3749
              • 24,544 Posts
              Quote from: Bruno17 at May 23, 2010, 06:26 AM

              I think you can modify the emailTo-value in a hook-snippet:

              <?php
              
              $scriptProperties['hook']->formit->config['emailTo']='[email protected]';
              return true; 


              I think that would work, although the OP might want a different email Tpl chunk for the confirmation email, which made me think of the duplicate email hook.
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting