2017 © Pedro PelĂĄez
 

library email-makr

Generate emailings with twig and csv

image

lyrixx/email-makr

Generate emailings with twig and csv

  • Saturday, June 8, 2013
  • by lyrixx
  • Repository
  • 1 Watchers
  • 5 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Email-Makr

With Email-Makr you design only one twig template and a csv with translated block. Then Email-Makr will generate all variants for your email., (*1)

Email-Makr takes as first argument a path to a twig template. It could be any valid twig template. For exemple:, (*2)

<li>lang : {{ lang }}</li>
<li>var1 : {{ var1 }}</li>
<li>var1 : {{ var2 }}</li>

Email-Makr takes as second argument a path to a csv file. The csv file should contains a least :, (*3)

  • One header row, with variable name. Theses variable names will be uses in twig template
  • Many row, with in the first column the target language. For exemple:
var1 var2
en value en 1 value en 2
fr value fr 1 value fr 2

See exemple for more information., (*4)

Usage

emailmakr template.html.twig datas.csv, (*5)

Options:, (*6)

  • --output-directory, default: ./emailings/
  • --output-format, default: "mail_LANG.html. LANG is a placeholder. It will be remplaced by the current language

Ouput looks for:, (*7)

$ ./emailmakr.php generate-email index.html.twig datas.csv
Generated "/var/www/dev/sensio/emailings/exemple/emailings/mail_fr.html"
Generated "/var/www/dev/sensio/emailings/exemple/emailings/mail_en.html"
Generated "/var/www/dev/sensio/emailings/exemple/emailings/mail_es.html"
Generated "/var/www/dev/sensio/emailings/exemple/emailings/mail_it.html"
Finished

Installation

Use it as a single file:

Downlaod email-makr and run it: php email-makr., (*8)

With Composer:

composer create-project lyrixx/email-makr email-makr, (*9)

The Versions

08/06 2013

dev-master

9999999-dev

Generate emailings with twig and csv

  Sources   Download

MIT

The Requires

 

The Development Requires