Git Product home page Git Product logo

craft-plugin---premailer's Introduction

Premailer Plugin for Craft

Premailer uses the Premailer API (http://premailer.dialect.ca/) to inline the CSS for HTML emails. This is especially useful when using the "template" feature in Craft's email settings.

Usage

{% premailer with {options} %}
    [[ Your Layout Here ]]
{% endpremailer %}
        

Don't forget to cache it!! ({% cache %} tag - See Example Below)

Options

All premailer options are supported, you can view details here: http://premailer.dialect.ca/api. If you want to use the defaults just leave the with clause out.

Example

{% cache %}

    {% premailer with {preserve_styles:false, remove_ids: true, remove_classes: true, remove_comments: true} %}
    {# you can also use: {% premailer %} #}
        <html>
            <head>
                <title>My Email Wrapper</title>
                <style type="text/css">
                    td {
                        font-family:arial,sans-serif;
                        font-size:14px;
                        line-height:20px;
                    }
                    .big-text {
                        font-size:50px; line-height:55px;
                    }
                </style>
            </head>
            <body>
                <table cellspacing="0" cellpadding="0" width="600" align="center">
                    <tr>
                        <td class="big-text">Headline</td>
                    </tr>
                    <tr>
                        <td>
                            <p>Lorem ipsum yo...</p>
                        </td>
                    </tr>
                </table>
            </body>
        </html>
    {% endpremailer %}

{% endcache %}

craft-plugin---premailer's People

Contributors

rkingon avatar

Watchers

 avatar  avatar

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.