kalenjordan/magento-twigmail

Twig email templates for Magento.

dev-master 2013-11-21 17:51 UTC

This package is not auto-updated.

Last update: 2024-04-22 13:01:11 UTC


README

Still pretty experimental, but provides basic support for Twig email templates for Magento.

Installation

Add to your composer.json:

"require": {
    "kalenjordan/magento-twigmail": "dev-master",
}

Usage

Then, when you're declaring a template file, just add the <renderer>twig</renderer> node.

<template>
    <email>
        <clean_twigmail_test_email_template translate="label" module="cleanshare">
            <label>Test Email</label>
            <file>twigmail/test.html.twig</file>
            <type>html</type>
            <renderer>twig</renderer>
        </clean_twigmail_test_email_template>
    </email>
</template>

You can also enable Twig rendering for a database template by having the Template Content start with {# twig #}.

Testing

You can trigger a test email by going to System > Configuration > System > Twig E-Mail Templates > Send Test

To Do

  • Haven't quite worked out yet how best to allow template overrides to happen. Should be possible by just overriding the email template config node, but overriding using transactional email templates in the databse isn't possible yet.

  • I tend to like managing email copy in the code base though, so it wasn't a huge priority for me.