GithubHelp home page GithubHelp logo

tedgoas / cerberus Goto Github PK

View Code? Open in Web Editor NEW
4.9K 139.0 707.0 2.93 MB

A few simple, but solid patterns for responsive HTML email templates and newsletters. Even in Outlook and Gmail.

Home Page: https://www.cerberusemail.com/

License: MIT License

HTML 100.00%
responsive-email html-email newsletter email email-boilerplate email-template hybrid-email cerberus

cerberus's Introduction

Cerberus Responsive Email Patterns

Cerberus logo

Coding regular emails is hard enough by itself. Making them responsive and accessible shouldn’t add to the headache. A few simple, but solid patterns are all that’s needed to optimize emails for small screens and assistive technologies.

That’s what Cerberus is.

It’s just a few responsive email patterns that go a long way. The code blocks are compartmentalized so that they may be used, combined, and nested to build an email.

Each template is annotated and has good support among popular email clients.

Contents

cerberus-fluid.html - Good for simple layouts such as transactional and single column emails.

cerberus-responsive.html - Good for more complicated, shape-shifting email layouts that work on some mobile clients.

cerberus-hybrid.html - This template uses a hybrid approach to reconfigure the layout for different screen sizes for email clients regardless of media query support.

Author

👋 I’m Ted Goas, the core author and maintainer. I’m a product designer & front-end developer with a soft spot for HTML emails. Some day I'd love to combine my professional craft and hobby to work on an email platform. @tedgoas § TedGoas.com

License

Let’s go with something simple and permissive, shall we?

The MIT License (MIT).

Copyright (c) Ted Goas

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Email Templates

If you’d prefer something that’s ready out of the box, I vouch for htmlemail.io’s responsive email templates. They’re fully tested and ready for your ESP or codebase.

cerberus's People

Contributors

alegout avatar andredss99 avatar bclark88 avatar coliff avatar douglasprofessional avatar dyspop avatar forsbergplustwo avatar fridde avatar hoducha avatar individual-it avatar jayoram avatar kgeis avatar leematos avatar m-evangelista avatar matthieusolente avatar navgator236 avatar pixeltuna avatar psychobunny avatar silverhazelazers avatar smalbs avatar sustmi avatar tedgoas avatar tradziej avatar vlntna avatar wgx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cerberus's Issues

Add <td valign="top">

Add <td valign="top"> to the very first <td> so short emails vertically align to the top if they don't take up the entire viewport height.

Remove .ExternalClass

Outlook is officially retiring the old Outlook.com rendering for new OWA rendering link, making this part of the CSS reset obsolete.

* [owa] { } targets new OWA clients, should the need ever arise.

ios mailbox not displaying properly

I used the default template and it looks great everywhere except on the mailbox app on ios. It seems to be stretching images to fill the device width if the image is larger than the screen instead of using the specified image or td width. I attached some images to further illustrate the issue.
Thanks
2e058ba8-b41f-426d-8c4c-88cd034b06f3
59fcbff3-11d2-43f7-8111-4950d6d9daa4

Mailchimp compatibility

I'm doing a responsive email template for a client - they have an account with mailchimp, so have to use it to send their email marketing.
Based on their design requirements, i cant just use one of the mailchimp templates.

So im basically populating the cerebrus files in a code editor, and importing to mailchimp. The layout breaks - no responsive, no fluid, no nothing :P

I did make sure it was not my changes by uploading just the original files (tested fluid and default), same issues - spacing, alignment and images go out of whack.

I was wondering if there is a bulletproof version for import to mailchimp available somewhere, or if that is something the community could look into creating?
So not a mailchimp template as such, but a file coded in such a way that i can populate it outside of mailchimp and be fine when i import it to send.

Attached image is what it looks like after importing to mailchimp and sending myself a test (I use gmail).

Thanks a mil, great work thus far!
cerberus

RTL in media query breaks line breaks

If you use the media query version of the template and you have the element with text left and image right this is achieved using table dir="rtl".

This causes the line breaks to do weird things. If the sentenced is split up it starts in the next line from the right but the next text is in the same line from the left. On OSX this is only visible with the dots of the sentence, but in Outlook this breaks the entire textblock.

full-width-image class

What is the purpose of this class applied to some of the tags like

<td class="full-width-image">

? The reason I ask is I don't see any corresponding styles defined.

Template-default 3 column issue

Hi there thanks for the awesome templates. First off, I'm a designer who is html/css savvy and not a developer. I'm having an issue with the 3-column section of the 'template-default' file.

I've removed the padding so the images touch the edge of the wrapper table and added placeholders that are 190px wide, looks fine in both regular and responsive layouts:
desktop

600px-moretextcontent

Funny thing is happening though when I remove text from the columns. For example, if I delete a sentence of the dummy copy, I get a gap on the right hand side when I hit the 600px threshold to a responsive layout:

600px-lesstextcontent

It may be a simple solution but I can't work out what's breaking, any ideas? Here's the code I'm using for the section, all other code - css etc. - has been kept the same in the template:

  <tr>
    <td>
      <table border="0" cellpadding="0" cellspacing="0" class="columns-container">
        <tr>
          <td align="center" width="190" style="font-family: sans-serif; font-size: 16px; line-height: 22px;padding-right: 15px;color: #444444;" valign="top" class="force-col">
            <img src="3col-plchldr-190x220.jpg" alt="alt text" height="220" width="190" border="0" style="display: block;padding-bottom: 10px;" class="col-3-img-r">
            <a href="#" style="color:#444444; font-weight:bold; text-decoration: none; text-transform: uppercase;">header</a>
            <br>
            Saepe scaevola id has. Duo et regione albucius ponderum. Dicta definitiones sed ex.
          </td>
          <td style="font-size: 0; line-height: 0; display: none;" class="hh-spacer">&nbsp;</td>
          <td align="center" width="190" style="font-family: sans-serif; font-size: 16px; line-height: 22px; padding-right: 15px;color: #444444;" valign="top" class="force-col">
            <img src="3col-plchldr-190x220.jpg" alt="alt text" height="220" width="190" border="0" style="display: block; padding-bottom: 10px;" class="col-3-img-l">
             <a href="#" style="color:#444444; font-weight:bold; text-decoration: none; text-transform: uppercase;">header</a>
            <br>
            Saepe scaevola id has. Duo et regione albucius ponderum. Dicta definitiones sed ex.
            </td>
          <td style="font-size: 0; line-height: 0; display: none;" class="hh-spacer">&nbsp;</td>
          <td align="center" width="190" style="font-family: sans-serif; font-size: 16px; line-height: 22px;color: #444444;" valign="top" class="force-col">
            <img src="3col-plchldr-190x220.jpg" alt="alt text" height="220" width="190" border="0" style="display: block;padding-bottom: 10px;" class="col-3-img-r">
             <a href="#" style="color:#444444; font-weight:bold; text-decoration: none; text-transform: uppercase;">header</a>
            <br>
            Saepe scaevola id has. Duo et regione albucius ponderum. Dicta definitiones sed ex.
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <!-- Three Column ==> Stacked Wide Layout ==> Stacked Narrow Layout : END -->

Thanks!

Bower integration

Just found your project, nice work! 👍

It would be great to have it on Bower package management: http://bower.io/

You just have to create a little config file and publish it. Can you plan it please? :-)

Thanks!

Retina images

Is there a workaround, or a suggestion for displaying high-density images? In particular for 100% width images for banners etc where you have height="" empty.

Usually, I would use both height and width, and load in an image that is double size:

<img src="http://placehold.it/1200x240/" width="600" height="120" border="0" alt=" ">

Table banding

Would I be correct in assuming that I'd need to nest in a new set of 100% width tables to achieve full-width banding within the sections?

Padding in Outlook 2000/2002/2003

Can these characteristics be replicated?

  • Can't define cell padding in percent
  • Cells of .email-container cannot be defined in CSS (though cellpadding works)

Question regarding css styles

@TedGoas,

We are in the process of building a new set of email templates and will be using Cerberus/hybrid as the base (thank you for it!).

Noticing the two sets of style rules, CSS Reset and Progressive Enhancements, I am wondering if they should be excluded from inliners like Premailer?

My instinct is to inline the CSS Reset and exclude the Progressive Enhancements as they contain media queries which I read as a sign to leave that set along.

Is this how you intended these?

Also, would you be available for short-time consulting (2-5h) in the next two weeks?

Let me know.

Andrei

Modifying Three Columns to Four

I'm hoping I can modify the Cerebus Hybrid file to show Four Even columns on Outlook, then breakpoint to Two columns on Tablet, then One column on mobile phones. Any thoughts or tips on that? Thanks!

Buttons

On my outlook, the button looses the link... both on default template, as in my customized one! Help?

Fluid-Hybrid template not displaying full-width on iPhone when sending via Constant Contact

I'm seeing an issue where the Cerberus fluid hybrid template isn't displaying full-width on iPhone Mail when sent via Constant Contact. The email only takes up about 50% of the width of the screen, and only affects portrait mode (looks ok in landscape).

I'm tried adjusting viewport and body width, along with doctype and a few other things... but I can't seem to get it to display correctly. Also, I'm seeing a flash/flicker where it displays full-width and then reshapes to 50%. Any idea what might be going on here, or how to fix?

The iPad portrait and landscape view looks good. So far, it's only doing this for iPhones as far as I can tell. And only when sent via Constant Contact. I'm wondering if it's something in their footer which I can't remove?

iphone-cerberus-constantcontact

Process documentation

Don't mean to add this as an issue, as I think it is more of a question or documentation thing (sorry if I shouldn't have posted it here). I've been researching various options for html e-mails and I like the simplicity of using Cerberus, but I'm curious about the process that should be taken. Specifically, if I take your template without changing much, do I need to run this through a CSS inliner tool? Or is it expected to work fine as is?

I tried running it through an inliner tool, and notice that everything between the style tags except for media queries gets removed. I wasn't sure if this was a necessary step, or if by doing this, it would break some styles for certain email clients.

Thanks for the great work!

Add Litmus test screen

Add png screenshots for each template

  • Reference to updated readme
  • Link in support section of Jekyll page

is there a non-inlined version ?

This is great, many thanks.

I find it much easier to customize on a non inlined version and then run it through email-inline tool like mailchimp's

Right margin (~20px) on iOS Mail app fix

Was experiencing a margin to the right of the viewport in iOS Mail.

iosmail-issue

Added

min-width: 100%;

to the body tag and that fixed the issue.

EDIT: It seems to be a mixture of two things. One being the min-width fix above. I also had to remove

table-layout: fixed;

from the Yahoo alignment fix in the styles. Tested in Yahoo and iOS and everything loks fine. Seems like the Yahoo alignment fix is now redundant, I just needed to center-align the main container (line 97).

Also removed table-layout: fixed; from line 97 as it was causing a Gmail bug - right hand side of Gmail interface overlaying the email content:

gmail-issue

All good in Yahoo, Gmail and iOS now.

Strange behavior with Sparrow

This might be more of an issue with Sparrow, but in the Sparrow client this:

`body,

bodyTable {

height:100% !important;
width:100% !important;
margin:0;
padding:0;

}`

causes the email content to "jump" as if it were a gif, and it slowly pushes the content down. It's the strangest thing ever. If you remove #bodyTable it doesn't happen. Just something to note.

Bug visualization on samsung s6/s6 email app

I'm italian so i'm sorry for my english.
I've discovered that hybrid template have an ugly right band when viewing on samsung s6/s7 email app.
I've made some test and i've also discovered that changing:

html,
body {
            margin: 0 !important;
            padding: 0 !important;
            height: 100% !important;
            width: 100% !important;
        }

to

html,
body {
            padding: 0 !important;
            height: 100% !important;
            width: 100% !important;
        }

solved the issue.
Hope it can help

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.