HTML emails
Permalink 4 users found helpful
I am using the Extended Form block, but I think it uses the same code as the regular c5 form to send out alert emails. I need to make the alert email that gets sent out an HTML email (logo, basic colors, etc) has anyone ever done this or have any pointers on how to go about it? Thanks -Brian
Haven't looked at integrating with Extended Form block, but we've started using the attached to send html email, ie:
really nice job mbone99,
i just made custom mail templates, ;)
in tony's mail addon, he uses a stripped down tinymce so its easy to style,
i just made custom mail templates, ;)
in tony's mail addon, he uses a stripped down tinymce so its easy to style,
Excellent solution, thanks!
Hi guys!
mbone99, thank you very much for posting this great and easy to use solution.
Cheers ;-)
mbone99, thank you very much for posting this great and easy to use solution.
Cheers ;-)
For future reference, just want to point out that is seems the built-in C5 mail helper includes HTML support (in 5.4.1.1 for sure, don't know about earlier versions).
To use it, just call the setBodyHTML() function. For example:
To use it, just call the setBodyHTML() function. For example:
$mh = Loader::helper('mail'); $mh->to($to); $mh->from($from); $mh->setSubject($subject); $mh->setBody($textBody); $mh->setBodyHTML($htmlBody); @$mh->sendMail();
Someone recently asked how to make the built-in form block send HTML emails in 5.5. Here's how:
1) Copy this file:
...to here:
2) Edit the new copy of the file, and change this line:
...to this:
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
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
Hi Jordan,
I tried this with concrete 5.5.2.1 but it doesn't work for me.
The email will be send but it has no content.
What im doing wrong?
Kind regards
- Kevin
I tried this with concrete 5.5.2.1 but it doesn't work for me.
The email will be send but it has no content.
What im doing wrong?
Kind regards
- Kevin
Please post the mail template file (the one you put into SITEROOT/mail/block_form_submission.php).
Hi Jordan,
Thanks for you reply.
I got it to work. There will be send an email.
But when i set a table to the block_form_submission.php like:
The form will hangs up.
After i click Submit, the screen turns white.
How can i format my HTML-Email?
Can i use normal HTML-Tags?
Kind regards
-Kevin
Thanks for you reply.
I got it to work. There will be send an email.
But when i set a table to the block_form_submission.php like:
<TABLE> <TR> <TD> TEST </TD> </TR> </TABLE>
The form will hangs up.
After i click Submit, the screen turns white.
How can i format my HTML-Email?
Can i use normal HTML-Tags?
Kind regards
-Kevin
Please post the mail template file (the one you put into SITEROOT/mail/block_form_submission.php).
I've thought for long that defining the HTML email is really clunky in C5. It should be easy to write out the mail template as you write any view template.
I've also done a pull request of this with no comments for ½ a year:
https://github.com/concrete5/concrete5/pull/406...
I've also done a pull request of this with no comments for ½ a year:
https://github.com/concrete5/concrete5/pull/406...
Thanx Jordanlev,
this is exactly where I was looking for.
Best regards,
Eric Brongers
Proracom
this is exactly where I was looking for.
Best regards,
Eric Brongers
Proracom