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
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.
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.
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.
I think you can modify the emailTo-value in a hook-snippet:
<?php
$scriptProperties['hook']->formit->config['emailTo']='[email protected]';
return true;
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.