Welcome to the arrogantly named library of, Good Email Code
I always enjoy writing and talking about email code so I decided to set up this site to share code and explain the reasons behind everything I’m doing. You are welcome to simply copy and paste code or you can read up and learn the theory behind it.
The code here is what I would call best practice (other may disagree) and my theory behind that is.
Priority is given to making sure the code works. This means making sure it is semantic, functional, accessible and meeting user expectations. Consistency between email clients and pixel perfect design are also important but always secondary.
Please also consider that this is a personal site and I’m dyslexic. It is probably full of spelling and grammar errors, don’t discount the content because of this, just politely let me know and I can fix it.
With all that in mind, look at these cool things I’ve written.
- Template - a base template to wrap all the email content in.
- Preheader - small preview text that shows in the inbox but not in the email.
- Text - basic text elements.
- Link Button - a link that is styled to look like a button.
- Hr - a horizontal rule, used to separate sections of content.
- CSS Triangles - A triangle shape, made with code to avoid using an image.