Magento – How to change reply-to email adress of contact form when using transactional email template


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?

Best Answer

The code which sends the contacts email is:

$post = $this->getRequest()->getPost();
// ... more code ...
$mailTemplate->setDesignConfig(array('area' => 'frontend'))
        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.