We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2178
    • 7 Posts
    I’d like to send a copy of the contact email to the person who fills out the form using FormIt. Ya, I’m new to MODx and I didn’t see any examples of what a complete custom hook in the documentation looks like so I’m unsure about how to create one. Here’s what I have:

    <?php
      $user = $scriptProperties['fields']['email'];
      $scriptProperties['hook']->formit->config['emailCC'] = $user;
      return true;
    ?>


    I’ve added this hook name into the hook parameter and it doesn’t work.
      • 30319
      • 406 Posts
      Grab the newest version, it enables cc, bcc, etc.
      I have tested, it works nicely.
      HTH Tom
        • 2178
        • 7 Posts
        Quote from: TomMLS at Aug 27, 2010, 10:03 AM

        Grab the newest version, it enables cc, bcc, etc.
        I have tested, it works nicely.
        HTH Tom

        Yes, we have the latest version. The BCC element works fine as well as CC when we set it at the snipet call. However, I don’t believe there’s a way (or perhaps I just don’t know how) to pass the email field value in the snipet call. That’s why I’m trying to write this hook, which is not working.
          • 30319
          • 406 Posts
          Do the Formit call like so and see what happens:

          [[!FormIt?
          &hooks=`email,redirect,recaptcha`
          &emailTpl=`email`
          &emailSubject=`Website Inquiry`
          &emailTo=`[email protected]`
          &emailCC=`[[+email]]`
          &emailBCC=`[email protected]`
          &emailFromName=`[[+name]]`
          &redirectTo=`15`
          ]]

          Note the [[+email]] and [[+name]] placeholders...

          HTH Tom
            • 2178
            • 7 Posts
            Nice! Thanks, that did the trick. The actual form uses [[+fi.name]] so I had assumed that was how you referenced that placeholder. Changed it to [[+email]] and that did it. smiley
              • 30319
              • 406 Posts
              Quote from: artmonkey87 at Aug 31, 2010, 01:07 PM

              Nice! Thanks, that did the trick. The actual form uses [[+fi.name]] so I had assumed that was how you referenced that placeholder. Changed it to [[+email]] and that did it. smiley

              This is explained in the new documentation. Many Revo things take quite a while to get used to.