Forums

Sending form info to admin and thank you to sender

brewer1st 29 Jul, 2007
This mod is great. I am a bit confused with some of the configuration fields.

Currently, I have a form that emails us with the contents of a form and redirects to a Thank You page.

I would like to have the responses from the form sent to one address and also have a "Thank You" email send to the person that filled out the form. Is this possible?

Thanks
GreyHead 29 Jul, 2007
Hi brewer1st,

This isn't implemented as a 'tick in the box' option but it is possible. You need to add the extra code to send the second e-mail. Set your form up as it is at present and then add something like this to the 'On Submit code - after sending email:' field on the 'Form Code' tab.
<?php
$recipient = $_POST[$paramsvalues->emailfield];
$html_message = "Hi,<br />Thank you for submitting your form.<br />Web admin";
$subject = $subject;
mosMail($from, $fromname, $recipient, $subject, $html_message, true, NULL, NULL, NULL, NULL, NULL );
?>


Not tested - so may require some de-bugging.

You can add your own 'thank you' message as $html_message; and change the $subject value if you want something other than the current value (if not you can delete this line).

Note: this is effectively a hack and uses parameters that could change in future versions of ChronoForms.

Bob
This topic is locked and no more replies can be posted.