2017 © Pedro PelĂĄez
 

symfony-bundle zurb-ink-bundle

Creating email templates is hard. This Bundle provides help.

image

gremo/zurb-ink-bundle

Creating email templates is hard. This Bundle provides help.

  • Friday, March 23, 2018
  • by gremo
  • Repository
  • 3 Watchers
  • 11 Stars
  • 8,544 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 21 Forks
  • 1 Open issues
  • 16 Versions
  • 90 % Grown

The README.md

GremoZurbInkBundle

Latest stable Downloads total GitHub issues, (*1)

:no_entry: Warning :no_entry: this project is now archived. It's ok to use it for legacy Symfony 2/3 projects, it should work fine. New Symfony project should use twig/cssinliner-extra and twig/inky-extra (see inlining CSS and use inky)., (*2)

Creating email templates is hard. This Symfony Bundle provides help., (*3)

The original bundle thampe/ZurbInkBundle is abandoned. This fork aims to provide a maintained version of the original project. I use this bundle at work, on daily basis, and I respect semantic versioning., (*4)

Do you have a good idea and want to contribute? Let's do it! Feel free to open an issue., (*5)

Upgrade

  • Last tag supporting Symfony 2 and 3 is 4.0.1. After that, this project only support Symfony 4 and 5.
  • Latest tag of the original project is 2.2.6. You can use this release only changing your Composer requirements.
  • Latest 2.x tag of my fork is 2.3.0 and contains some bug fixes. You can use this release changing your Composer requirements and bundle name in the kernel.

Installation

Install the bundle via Composer:, (*6)

composer require gremo/zurb-ink-bundle

Then enable the bundle in the config/bundles.php:, (*7)

<?php
// config/bundles.php

return [
    // ...
    Gremo\ZurbInkBundle\GremoZurbInkBundle::class => ['all' => true],
    // ...
];

Usage

First we need to create a template for our HTML email. You can use Foundation for Emails and Inky or write it from scratch., (*8)

Working with Foundation for Emails and Inky

Foundation for Emails is a framework for building HTML responsive emails while Inky is a templating language that converts simple HTML tags into the complex table HTML required for emails., (*9)

Extend the base Foundation for Emails layout and override the content block:, (*10)

{% extends '@GremoZurbInk/foundation-emails/base.html.twig' %}

{% block content %}
    {# Inky markup and plain HTML #}
{% endblock %}

The base layout includes Foundation for Emails CSS (inlined only). Custom styles can be added overriding the stylesheets block (see Adding styles)., (*11)

From scratch

Not using Foundation for Emails or Inky markup? Extend the base layout and override the body block:, (*12)

{% extends '@GremoZurbInk/base.html.twig' %}

{% block body %}
    {# Plain HTML #}
{% endblock %}

Custom styles can be added overriding the stylesheets block (see Adding styles)., (*13)

Adding styles

Email clients typically support only a subset of valid HTML, and don’t have strong support for CSS (especially CSS in the <head> of the HTML email). Yahoo, Outlook, and even Gmail strip CSS that’s included in the <head> of your HTML, so in most cases CSS inlining is necessary., (*14)

Stylesheets can be added calling the zurb_ink_add_stylesheet Twig function inside the stylesheets block:, (*15)

{# ... #}

{% block stylesheets %}
    {{ parent() }}

    {# Custom CSS (inlined only) #}
    {{ zurb_ink_add_stylesheet('css/style.css') }}
{% endblock %}

{# ... #}

By default this will only inline the CSS. Pass a truthy value as second argument to both inline and output the CSS into the <style> tag:, (*16)

{# ... #}

{% block stylesheets %}
    {{ parent() }}

    <style type="text/css">
        {# Custom CSS (both inlined and outputted) #}
        {{ zurb_ink_add_stylesheet('@AppBundle/Resources/public/css/style.css', true) }}
    </style>
{% endblock %}

{# ... #}

The Versions

23/03 2018

dev-master

9999999-dev http://github.com/gremo/ZurbInkBundle

Creating email templates is hard. This Bundle provides help.

  Sources   Download

MIT

The Requires

 

email template zurb ink

23/03 2018

v3.0.1

3.0.1.0 http://github.com/gremo/ZurbInkBundle

Creating email templates is hard. This Bundle provides help.

  Sources   Download

MIT

The Requires

 

email template zurb ink

23/03 2018

v3.0.0

3.0.0.0 http://github.com/gremo/ZurbInkBundle

Creating email templates is hard. This Bundle provides help.

  Sources   Download

MIT

The Requires

 

email template zurb ink

17/02 2018

v2.3.0

2.3.0.0 http://github.com/gremo/ZurbInkBundle

Creating email templates is hard. This Bundle provides help.

  Sources   Download

MIT

The Requires

 

email template zurb ink

05/02 2018

2.2.6

2.2.6.0 http://github.com/thampe/ZurbInkBundle

Creating email templates is hard. This Bundle provides help.

  Sources   Download

MIT

The Requires

 

email template zurb ink

30/06 2017

2.2.5

2.2.5.0 http://github.com/thampe/ZurbInkBundle

Creating email templates is hard. This Bundle provides help.

  Sources   Download

MIT

The Requires

 

email template zurb ink

26/03 2017

dev-develop

dev-develop http://github.com/thampe/ZurbInkBundle

Creating email templates is hard. This Bundle provides help.

  Sources   Download

MIT

The Requires

 

email template zurb ink

26/03 2017

2.2.4

2.2.4.0 http://github.com/thampe/ZurbInkBundle

Creating email templates is hard. This Bundle provides help.

  Sources   Download

MIT

The Requires

 

email template zurb ink

13/03 2017

2.2.3

2.2.3.0 http://github.com/thampe/ZurbInkBundle

Creating email templates is hard. This Bundle provides help.

  Sources   Download

MIT

The Requires

 

email template zurb ink

27/12 2016

2.2.2

2.2.2.0 http://github.com/thampe/ZurbInkBundle

Creating email templates is hard. This Bundle provides help.

  Sources   Download

MIT

The Requires

 

email template zurb ink

14/08 2016

2.2.1.0

2.2.1.0 http://github.com/thampe/ZurbInkBundle

Creating email templates is hard. This Bundle provides help.

  Sources   Download

MIT

The Requires

 

email template zurb ink

23/04 2016

2.1.0.0

2.1.0.0 http://github.com/thampe/ZurbInkBundle

Creating email templates is hard. This Bundle provides help.

  Sources   Download

MIT

The Requires

 

email template zurb ink

14/12 2015

1.0.10

1.0.10.0 http://github.com/thampe/ZurbInkBundle

Creating email templates is hard. This Bundle provides help.

  Sources   Download

MIT

The Requires

 

email template zurb ink

11/12 2015

1.0.9

1.0.9.0 http://github.com/thampe/ZurbInkBundle

Creating email templates is hard. This Bundle provides help.

  Sources   Download

MIT

The Requires

 

email template zurb ink

21/03 2015

1.0.8

1.0.8.0 http://github.com/thampe/ZurbInkBundle

Creating email templates is hard. This Bundle provides help.

  Sources   Download

MIT

The Requires

 

email template zurb ink

17/01 2014

1.0.5

1.0.5.0 http://github.com/thampe/ZurbInkBundle

Creating email templates is hard. This Bundle provides help.

  Sources   Download

MIT

The Requires

 

email template zurb ink