From 4207a79ea81d643f8e4b7cbce72ee1d082bc0f62 Mon Sep 17 00:00:00 2001 From: Nic Jansma Date: Mon, 3 Dec 2012 12:29:57 -0500 Subject: [PATCH] Documentation and example update for ejs include directive --- Readme.md | 9 +++++++-- examples/templates/footer/html.ejs | 2 ++ examples/templates/footer/text.ejs | 1 + examples/templates/header/html.ejs | 2 ++ examples/templates/header/text.ejs | 1 + examples/templates/newsletter/html.ejs | 6 ++---- examples/templates/newsletter/text.ejs | 2 ++ examples/templates/pasta-dinner/html.ejs | 6 ++---- examples/templates/pasta-dinner/text.ejs | 2 ++ package.json | 3 ++- 10 files changed, 23 insertions(+), 11 deletions(-) create mode 100644 examples/templates/footer/html.ejs create mode 100644 examples/templates/footer/text.ejs create mode 100644 examples/templates/header/html.ejs create mode 100644 examples/templates/header/text.ejs diff --git a/Readme.md b/Readme.md index 8524604..9ac318a 100644 --- a/Readme.md +++ b/Readme.md @@ -1,8 +1,11 @@ -# node-email-templates 0.0.6 +# node-email-templates 0.0.7 Node.js module for rendering beautiful emails with [ejs][1] templates and email-friendly inline CSS using [juice][2]. +**v0.0.7**: +* Added support for ejs's `include` directive thanks to @nicjansma + **v0.0.6**: * Fixed batch problem (`...has no method slice`) thanks to @vekexasia @@ -52,7 +55,8 @@ npm install email-templates-windows * `html.ejs` - html + [ejs][1] version of your email template (**required**) * `text.ejs` - text + [ejs][1] version of your email template (**optional**) * `style.css` - stylesheet for the template, which will render `html.ejs` with inline CSS (**optional**) -5. Utilize one of the examples below for your respective email module and start sending beautiful emails! +5. You may use the `include` directive from ejs (for example, to include a common header or footer). See the `/examples` folder for details. +6. Utilize one of the examples below for your respective email module and start sending beautiful emails! # EJS Custom Tags @@ -366,6 +370,7 @@ emailTemplates(templatesDir, function(err, template) { * Nick Baugh * Andrea Baccega +* Nic Jansma (http://nicj.net) ## License diff --git a/examples/templates/footer/html.ejs b/examples/templates/footer/html.ejs new file mode 100644 index 0000000..43d6081 --- /dev/null +++ b/examples/templates/footer/html.ejs @@ -0,0 +1,2 @@ + + diff --git a/examples/templates/footer/text.ejs b/examples/templates/footer/text.ejs new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/examples/templates/footer/text.ejs @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/templates/header/html.ejs b/examples/templates/header/html.ejs new file mode 100644 index 0000000..255d9b8 --- /dev/null +++ b/examples/templates/header/html.ejs @@ -0,0 +1,2 @@ + + diff --git a/examples/templates/header/text.ejs b/examples/templates/header/text.ejs new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/examples/templates/header/text.ejs @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/templates/newsletter/html.ejs b/examples/templates/newsletter/html.ejs index 0cac3ef..4b9242b 100644 --- a/examples/templates/newsletter/html.ejs +++ b/examples/templates/newsletter/html.ejs @@ -1,5 +1,3 @@ - - +<% include ../header/html %>

Hi there <%= name.first %> <%= name.last %>

- - +<% include ../footer/html %> \ No newline at end of file diff --git a/examples/templates/newsletter/text.ejs b/examples/templates/newsletter/text.ejs index 858ef96..8c6afde 100644 --- a/examples/templates/newsletter/text.ejs +++ b/examples/templates/newsletter/text.ejs @@ -1 +1,3 @@ +<% include ../header/text %> Hi there <%= name.first %> <%= name.last %>. +<% include ../footer/text %> \ No newline at end of file diff --git a/examples/templates/pasta-dinner/html.ejs b/examples/templates/pasta-dinner/html.ejs index df9546c..7cba7df 100644 --- a/examples/templates/pasta-dinner/html.ejs +++ b/examples/templates/pasta-dinner/html.ejs @@ -1,7 +1,5 @@ - - +<% include ../header/html %>

You are invited to our weekly pasta dinner!

This week's pasta is: <%= pasta %>

We hope to see you there!

- - +<% include ../footer/html %> \ No newline at end of file diff --git a/examples/templates/pasta-dinner/text.ejs b/examples/templates/pasta-dinner/text.ejs index e38314b..0771532 100644 --- a/examples/templates/pasta-dinner/text.ejs +++ b/examples/templates/pasta-dinner/text.ejs @@ -1,5 +1,7 @@ +<% include ../header/text %> You are invited to join our weekly pasta dinner! This week's pasta is: <%= pasta %> We hope to see you there! +<% include ../footer/text %> \ No newline at end of file diff --git a/package.json b/package.json index bd3626b..183b94f 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,12 @@ { "name": "email-templates" , "description": "Node.js module for rendering beautiful emails with ejs templates and email-friendly inline CSS using juice." - , "version": "0.0.6" + , "version": "0.0.7" , "author": "Nick Baugh " , "contributors": [ { "name": "Nick Baugh", "email": "niftylettuce@gmail.com" } , { "name": "Andrea Baccega", "email": "vekexasia@gmail.com" } + , { "name": "Nic Jansma", "web": "http://nicj.net" } ] , "keywords": [ "node-email-templates", "ejs", "email", "templates", "email-templates", "juice", "inline", "css" ] , "homepage": "https://github.com/niftylettuce/node-email-templates"