Send a copy of form submission to senders email

simonusher3
28 Posts
simonusher3 posted this 14 July 2020
Ask a Question

Hi,

I would like to send a copy of the form submission to be sent to my email as well as the sender. Currently the php script only sends to my email. I have already worked out to get the senders email on Reply-To by editing the form.php file by replacing:

    'from' => ' ',

to

    'from' => $_POST["email"];

Now looking in the formprocessor.php , what part needs editing or more code is required so this could happen? Please note, I haven't used php for about 10 years and I can already see php coding has changed, so if anyone who is up to date in php could help, that would be much appreciated.

Regards,

Simon.

Hi, I would like to send a copy of the form submission to be sent to my email as well as the sender. Currently the php script only sends to my email. I have already worked out to get the senders email on Reply-To by editing the form.php file by replacing: 'from' => ' ', to 'from' => $_POST["email"]; Now looking in the formprocessor.php , what part needs editing or more code is required so this could happen? Please note, I haven't used php for about 10 years and I can already see php coding has changed, so if anyone who is up to date in php could help, that would be much appreciated. Regards, Simon.
Vote to pay developers attention to this features or issue.
2 Replies
Order By: Standard | Newest
DigiKing Web Solutions
2 Posts
DigiKing Web Solutions posted this 16 July 2020

This would be a most awesome feature!

This would be a most awesome feature!
simonusher3
28 Posts
simonusher3 posted this 24 August 2020

Hi All,

If anybody is interested, I know Monty will be at least. I have been studying PHP and the FormProcessor.php and finally worked out how to send a copy of the contact form to yourself and the sender at the same time. To start with as mentioned above, you need to edit your form-*.php. Then you will need to add some code to the FormProcessor.php.

First, find the following.

        $sent = @mail($to, $subject, $message, $headers);

    if(!$sent) {
        die($this->_getErrorResponse($this->_messages['failed_to_send_email']));
    }

Then insert the following after }

        $subject = $form['subject'];
    $message = $this->_getEmailBody($subject, $form['email_message'], $form['fields']);
    $headers = $this->_getEmailHeaders($to, $to);


    $sent2 = @mail($emailFrom, $subject, $message, $headers);

Now you can reply directly from your email client to the sender and the sender can reply direct back to you. Hopefully this help others that require this function when creating forms.

Regards,

Simon.

Hi All, If anybody is interested, I know Monty will be at least. I have been studying PHP and the FormProcessor.php and finally worked out how to send a copy of the contact form to yourself and the sender at the same time. To start with as mentioned above, you need to edit your form-*.php. Then you will need to add some code to the FormProcessor.php. First, find the following. $sent = @mail($to, $subject, $message, $headers); if(!$sent) { die($this->_getErrorResponse($this->_messages['failed_to_send_email'])); } Then insert the following after } $subject = $form['subject']; $message = $this->_getEmailBody($subject, $form['email_message'], $form['fields']); $headers = $this->_getEmailHeaders($to, $to); $sent2 = @mail($emailFrom, $subject, $message, $headers); Now you can reply directly from your email client to the sender and the sender can reply direct back to you. Hopefully this help others that require this function when creating forms. Regards, Simon.
You must log in or register to leave comments