Code Monkey home page Code Monkey logo

clmailerbundle's Introduction

MailerBundle Software License

Bundle providing abstraction for mailer services and templates. One of it's key features is that it let's you support both HTML and plain text formatting in one template.

Build Status Coverage Status Quality Score Latest Version Total Downloads

Features

  • Supports Twig and PHP templates
  • Automatically handles the different formatting of HTML and plain-text e-mails for you
  • Use your own stylesheet and have it injected into the e-mail's HTML as inline style-attributes automatically (maximum compatibility with e-mail readers like Google's - see aim of this bundle below)!
  • Base HTML layout already has a very decent set-up for you to use (but you can always go your own way of course!)
  • Create mailers by simply tagging them with cl_mailer.mailer. Keep your constructor/dependencies to yourself!
  • Install the KnpMarkdownBundle and use the power of markdown templates; one template for both HTML and plain-text (see Usage)!
  • Easily translatable subjects for your e-mails (just define them under the mailer domain)
  • Re-use default configuration: define it once and forget!

Documentation

Aim of this bundle

Remove any repetitive work

The aim of the this bundle is to abstract away the work of rendering and sending e-mails, and make sure that as much e-mail clients are supported as possible (for HTML e-mails).

Re-use values across different email types

To achieve this a set of e-mail types can be defined by you in configuration, along with some helpful defaults. Then, whenever you want to send an e-mail of one of these pre-defined types, you only have to refer to it by it's name.

The mailer can then re-use the pre-defined values, along with any values provided by you during the actual sending of the e-mail.

Besides having these pre-set defaults, I have also done my best to provide a very compatible HTML layout to extend from (see the {% extend layout %} example below).

Write CSS, but support all e-mail clients (converted to inline style-attributes)

Additionally, I have added a way for you to provide a stylesheet that will be included in the rendered e-mail. What's special about it is that the stylesheet won't simply be included within <style>-tags (because that would not be compatible with EVERY mail-client's rendering rules, like Gmail).

Instead, your stylesheet will be merged into the final rendered HTML as inline style-attributes for maximum compatibility (even with Gmail)!.

The default stylesheet used is located under vendor/cleentfaar/mailer-bundle/Resources/mailer/stylesheet.css.twig. You can define your own stylesheet under the stylesheet configuration option:

# app/config/config.yml
cl_mailer:
  defaults:
    stylesheet: %kernel.root_dir%/../web/css/mail.css

Attributions

Contributing

If you would like to contribute to this package, check out the contribution doc here.

clmailerbundle's People

Watchers

 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.