2

I am using a custom template for the contact form because I need a unique subject line for incoming contact form. I got that working by using a custom transactional email template. But now I came across a new problem: the reply-to email is set to an email address of our store instead of the person who filled in the form.

How can I use the customer's email address as the reply-to address?

2
  • Which contact form??
    – philwinkle
    Jul 16, 2013 at 13:51
  • The default contact form of Magento...? Jul 16, 2013 at 14:07

1 Answer 1

3

The code which sends the contacts email is:

$post = $this->getRequest()->getPost();
// ... more code ...
$mailTemplate->setDesignConfig(array('area' => 'frontend'))
    ->setReplyTo($post['email'])
    ->sendTransactional(
        Mage::getStoreConfig(self::XML_PATH_EMAIL_TEMPLATE),
        Mage::getStoreConfig(self::XML_PATH_EMAIL_SENDER),
        Mage::getStoreConfig(self::XML_PATH_EMAIL_RECIPIENT),
        null,
        array('data' => $postObject)
    );

You can see, it uses the value email which was posted from the contacts form, which actually is exactly what you want. Some modification you or an extension you installed must have changed the default behavior.

2
  • Hi thanks for your anwser. I am not using an extension or whatsoever. I just used a custom template from the Magento settings for tranactional emails. I was hoping for a non-codeing solution. Jul 16, 2013 at 14:46
  • You must have broken the default reply_to functionality with your custom contacts template. The email template has no part in that. Post your custom contacts/form.phtml template for further info.
    – Vinai
    Jul 16, 2013 at 14:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.