Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best Way To Format An HTML Email? [closed]

Tags:

html

email

format

I am implementing a comment control that allows a person to select comments and have them sent to specified departments. The email needs to be formatted in a specific way, and I was wondering what the best way to do this would be.

Should I just hard code all of the style information into one massive method, or should I try and create a separate file and read it in, and then replace certain tags with the relevant information?

like image 606
Andrew Burgess Avatar asked Sep 19 '08 13:09

Andrew Burgess


2 Answers

Find and use some kind of template library, if possible. This will make each email a template which will then be much easier to maintain than the hardcoded form.

like image 93
pjz Avatar answered Sep 28 '22 06:09

pjz


Campaign monitor has some great, well-tested free templates:

http://www.campaignmonitor.com/templates/

Make sure whatever you use will display well in all clients.

A great guide:

http://www.campaignmonitor.com/blog/archives/2008/05/2008_email_design_guidelines.html

like image 23
Buzz Avatar answered Sep 28 '22 06:09

Buzz