Archive

How to add a Reply-To header in email messages sent through Plone

Plone ships with an author feedback form that enables logged in users to contact other portal members. When the form is submitted, an email message is sent to the target user, using the site's global email address in the "From:" email header. We had to partially change this behavior by adding a "Reply-To:" in the message headers, so that when the user replies to the email received, the reply will be sent to the user that filled in the contact form, rather than the Plone site's global address.

The solution is easy, albeit not immediately obvious. All we need to do is customize author_feedback_template.pt and prepend the following line.

Reply-To: <span tal:replace="options/send_from_address"/>

We can do that either through the web using the ZMI, by pointing our browser to http://mysite.com/portal_skins/plone_templates/author_feedback_template/manage_main and clicking on customize, or through the file system, by adding a modified author_feedback_template.pt in the myproduct/skins/myproduct_custom_templates folder of our custom Plone product.