How to send email from a form as HTML?

Permalink
I can't figure out how to send form submission emails as HTML not plain text.

I don't seem to be able to do what was suggested in an older thread:http://www.concrete5.org/community/forums/customizing_c5/html-email... maybe because I'm running a newer version? (5.5.2.1)

Do I need to change something in the form/controller.php or do I have to edit the mail helper, and if so how??

Thank you!

prestressed
 
prestressed replied on at Permalink Reply
prestressed
ok so in the end I asked Jordan Lev, and this is the answer:

1) Copy this file:

SITEROOT/concrete/mail/block_form_submission.php


...to here:

SITEROOT/mail/block_form_submission.php


2) Edit the new copy of the file, and change this line:

$body = t("

...to this:

$bodyHTML = t("


3) Now you can edit the contents of the email to be HTML. Note that you might also want to define a plain old $body variable (if you want the email to have both HTML and plain text versions). Also, for the HTML email you'll probably want to change the line breaks in between each question/answer pair into <br /> tags (so on line 6, replace each "\r\n" with "<br />").

-Jordan