Skip to content

Commit

Permalink
added inital files
Browse files Browse the repository at this point in the history
  • Loading branch information
Paolo Memoli committed Mar 24, 2016
1 parent 50f5416 commit 3b549e2
Show file tree
Hide file tree
Showing 5 changed files with 1,236 additions and 0 deletions.
37 changes: 37 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
var path = require('path')
var sampleDir = path.join(__dirname, 'templates', 'sample')
var EmailTemplate = require('email-templates').EmailTemplate
var fs = require('fs-extra')
var async = require('async')
var slug = require('slug')

var sample = new EmailTemplate(sampleDir)

var tests = [
{
background: 'https://gallery.mailchimp.com/4ca7b1922d93f327ebc560d44/images/041b0b62-52c0-483f-a5e2-57bed9cad390.png',
title: 'Done in 3, 2, 1!',
subtitle: 'Power your marketing with user-generated content in 3 steps.',
cta: 'Check it out'
}
]

var outputDir = path.join(sampleDir, 'output')

fs.remove(outputDir, function (err) {
if (err) return console.error(err)
console.log('output folder removed')
})

async.each(tests, function (test, next) {
sample.render(test, function (err, result) {
if (err) return next(err)

fs.outputFile(path.join(outputDir, slug(test.title + '.html')), result.html, function (err) {
console.log(err || test.title) // => null
})

})
}, function (err) {
console.log(err);
})
27 changes: 27 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "climb-email-templates",
"version": "1.0.0",
"description": "A system to generate all the emails",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Climb-social/email-templates.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/Climb-social/email-templates/issues"
},
"homepage": "https://github.com/Climb-social/email-templates#readme",
"dependencies": {
"ejs": "^2.4.1",
"email-templates": "^2.2.0",
"fs-extra": "^0.26.7",
"jade": "^1.11.0",
"node-sass": "^3.4.2",
"slug": "^0.9.1"
}
}
327 changes: 327 additions & 0 deletions templates/sample/html.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,327 @@
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">

<head>
<!--[if gte mso 15]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Climb.Social</title>
</head>

<body>
<center>
<table align="center" border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable">
<tr>
<td align="center" valign="top" id="bodyCell">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" valign="top" id="templatePreheader">
<!--[if gte mso 9]>
<table align="center" border="0" cellspacing="0" cellpadding="0" width="600" style="width:600px;">
<tr>
<td align="center" valign="top" width="600" style="width:600px;">
<![endif]-->
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" class="templateContainer">
<tr>
<td valign="top" class="preheaderContainer">
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="mcnTextBlock" style="min-width:100%;">
<tbody class="mcnTextBlockOuter">
<tr>
<td valign="top" class="mcnTextBlockInner">

<table align="left" border="0" cellpadding="0" cellspacing="0" width="282" class="mcnTextContentContainer">
<tbody>
<tr>
<td valign="top" class="mcnTextContent" style="padding-top:9px; padding-left:18px; padding-bottom:9px; padding-right:0;">
<div dir="rtl" style="text-align: left;">
<a href="http://climb.social" target="_blank">
<img align="none" height="24" src="https://gallery.mailchimp.com/4ca7b1922d93f327ebc560d44/images/ced4a50c-bcf1-4f99-a216-9cc00c106b29.png" style="width: 145px; height: 24px; margin: 0px;" width="145">
</a>&nbsp;</div>
</td>
</tr>
</tbody>
</table>
<table align="right" border="0" cellpadding="0" cellspacing="0" width="282" class="mcnTextContentContainer">
<tbody>
<tr>
<td valign="top" class="mcnTextContent" style="padding-top:9px; padding-right:18px; padding-bottom:9px; padding-left:18px;">
<div style="text-align: right;">
<a href="http://app.climb.social" target="_blank">
<strong>Log in</strong>
</a>
</div>

</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
<!--[if gte mso 9]>
</td>
</tr>
</table>
<![endif]-->
</td>
</tr>
<tr>
<td align="center" valign="top" id="templateHeader">
<!--[if gte mso 9]>
<table align="center" border="0" cellspacing="0" cellpadding="0" width="600" style="width:600px;">
<tr>
<td align="center" valign="top" width="600" style="width:600px;">
<![endif]-->
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" class="templateContainer">
<tr>
<td valign="top" class="headerContainer">
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="mcnCodeBlock">
<tbody class="mcnTextBlockOuter">
<tr>
<td valign="top" class="mcnTextBlockInner">
<table cellpadding="0" cellspacing="0" border="0" height="231" width="100%">
<tbody>
<tr>
<td background="<%= background %>" bgcolor="#1A5077" valign="top">
<!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="mso-width-percent:1000;height:231px;">
<v:fill type="tile" src="<%= background %>"
color="#1A5077" />
<v:textbox inset="0,0,0,0">
<![endif]-->
<div class="mcnTextContent">
<h1 style="margin-top:35px;">
<%= title %>
</h1>
<h3>
<%= subtitle %>
</h3>
<div>
<!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="http://app.climb.social" style="height:53px;v-text-anchor:middle;width:200px;" arcsize="10%" stroke="f" fillcolor="#0096DE">
<w:anchorlock/>
<center>
<![endif]-->
<a href="http://app.climb.social" style="background-color:#0096DE;border-radius:5px;color:#ffffff;display:inline-block;line-height:43px;text-align:center;text-decoration:none;width:170px;-webkit-text-size-adjust:none; margin-top:22px">
<%= cta %>
</a>
<!--[if mso]>
</center>
</v:roundrect>
<![endif]-->
</div>
</div>
<!--[if gte mso 9]>
</v:textbox>
</v:rect>
<![endif]-->
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
<!--[if gte mso 9]>
</td>
</tr>
</table>
<![endif]-->
</td>
</tr>
<tr>
<td align="center" valign="top" id="templateBody">
<!--[if gte mso 9]>
<table align="center" border="0" cellspacing="0" cellpadding="0" width="600" style="width:600px;">
<tr>
<td align="center" valign="top" width="600" style="width:600px;">
<![endif]-->
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" class="templateContainer">
<tr>
<td valign="top" class="bodyContainer">
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="mcnCodeBlock">
<tbody class="mcnTextBlockOuter">
<tr>
<td valign="top" class="mcnTextBlockInner">
<div class="mcnTextContent" style="margin:15px;">
{{ content }}
</div>
</td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="mcnDividerBlock" style="min-width:100%;">
<tbody class="mcnDividerBlockOuter">
<tr>
<td class="mcnDividerBlockInner" style="min-width:100%; padding:18px;">
<table class="mcnDividerContent" border="0" cellpadding="0" cellspacing="0" width="100%" style="min-width: 100%;border-top-width: 2px;border-top-style: solid;border-top-color: #E8F2F9;">
<tbody>
<tr>
<td>
<span></span>
</td>
</tr>
</tbody>
</table>
<!--
<td class="mcnDividerBlockInner" style="padding: 18px;">
<hr class="mcnDividerContent" style="border-bottom-color:none; border-left-color:none; border-right-color:none; border-bottom-width:0; border-left-width:0; border-right-width:0; margin-top:0; margin-right:0; margin-bottom:0; margin-left:0;" />
-->
</td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="mcnTextBlock" style="min-width:100%;">
<tbody class="mcnTextBlockOuter">
<tr>
<td valign="top" class="mcnTextBlockInner">
<table align="left" border="0" cellpadding="0" cellspacing="0" width="100%" style="min-width:100%;" class="mcnTextContentContainer">
<tbody>
<tr>
<td valign="top" class="mcnTextContent" style="padding-top:9px; padding-right: 18px; padding-bottom: 9px; padding-left: 18px;">
<h2 class="null">Still have questions?</h2>
<p>Feel free to contact our support team.</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="mcnCodeBlock">
<tbody class="mcnTextBlockOuter">
<tr>
<td valign="top" class="mcnTextBlockInner">
<div class="mcnTextContent" style="margin:0 15px;">
<div style="display:inline-block;">
<!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="mailto:[email protected]" style="height:50px;v-text-anchor:middle;width:170px;" arcsize="10%" strokecolor="#1A5077" fillcolor="#ffffff">
<w:anchorlock/>
<center style="><img style="width:12px;" src="https://gallery.mailchimp.com/4ca7b1922d93f327ebc560d44/images/a33647bf-7742-4fee-a9b8-a94bf9211e5b.png"> Email Support</center>
</v:roundrect>
<![endif]-->
<a href="mailto:[email protected]" style="color:#1A5077;border:2px solid #1A5077;border-radius:5px;display:inline-block; font-size:13px;line-height:45px;text-align:center;text-decoration:none;width:170px;-webkit-text-size-adjust:none;mso-hide:all;">
<img style="width:12px;" src="https://gallery.mailchimp.com/4ca7b1922d93f327ebc560d44/images/a33647bf-7742-4fee-a9b8-a94bf9211e5b.png"> Email Support</a>
</div>
<div style="display:inline-block; margin:0 15px;">
<!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="https://twitter.com/climbsocialuk" style="height:50px;v-text-anchor:middle;width:170px;" arcsize="10%" strokecolor="#1A5077" fillcolor="#ffffff">
<w:anchorlock/>
<center style="><img style="width:12px;" src="https://gallery.mailchimp.com/4ca7b1922d93f327ebc560d44/images/08281770-3cf0-479f-804c-bb1bfe096bcd.png"> @ClimbSocialUK</center>
</v:roundrect>
<![endif]-->
<a href="https://twitter.com/climbsocialuk" style="color:#1A5077;border:2px solid #1A5077;border-radius:5px;display:inline-block; font-size:13px;line-height:45px;text-align:center;text-decoration:none;width:170px;-webkit-text-size-adjust:none;mso-hide:all;">
<img style="width:12px;" src="https://gallery.mailchimp.com/4ca7b1922d93f327ebc560d44/images/08281770-3cf0-479f-804c-bb1bfe096bcd.png"> @ClimbSocialUK</a>
</div>
<div style="display:inline-block;">
<!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="http://" style="height:50px;v-text-anchor:middle;width:170px;" arcsize="10%" strokecolor="#1A5077" fillcolor="#ffffff">
<w:anchorlock/>
<center style="><img style="width:12px;" src="https://gallery.mailchimp.com/4ca7b1922d93f327ebc560d44/images/fca4dbe2-babc-4b45-b67c-7036b1d7393d.png"> Live chat</center>
</v:roundrect>
<![endif]-->
<a href="http://app.climb.social" style="color:#1A5077;border:2px solid #1A5077;border-radius:5px;display:inline-block; font-size:13px;line-height:45px;text-align:center;text-decoration:none;width:170px;-webkit-text-size-adjust:none;mso-hide:all;">
<img style="width:12px;" src="https://gallery.mailchimp.com/4ca7b1922d93f327ebc560d44/images/fca4dbe2-babc-4b45-b67c-7036b1d7393d.png"> Live Chat</a>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
<!--[if gte mso 9]>
</td>
</tr>
</table>
<![endif]-->
</td>
</tr>
<tr>
<td align="center" valign="top" id="templateFooter">
<!--[if gte mso 9]>
<table align="center" border="0" cellspacing="0" cellpadding="0" width="600" style="width:600px;">
<tr>
<td align="center" valign="top" width="600" style="width:600px;">
<![endif]-->
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" class="templateContainer">
<tr>
<td valign="top" class="footerContainer">
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="mcnTextBlock" style="min-width:100%;">
<tbody class="mcnTextBlockOuter">
<tr>
<td valign="top" class="mcnTextBlockInner">
<table align="left" border="0" cellpadding="0" cellspacing="0" width="100%" style="min-width:100%;" class="mcnTextContentContainer">
<tbody>
<tr>
<td valign="top" class="mcnTextContent" style="padding-top:9px; padding-right: 18px; padding-bottom: 9px; padding-left: 18px;">
<a href="http://climb.social" target="_blank">
<img align="none" height="32" src="https://gallery.mailchimp.com/4ca7b1922d93f327ebc560d44/images/d65393cd-d8cf-4ad9-a058-dfe2a976edee.png" style="width: 32px; height: 32px; margin: 0px;" width="32">
</a>
<p>Stay connected with tips, updates and resources
<br>
<br>
<a href="https://twitter.com/climbsocialuk" target="_blank">
<img align="none" height="45" src="https://gallery.mailchimp.com/4ca7b1922d93f327ebc560d44/images/bd97b394-e3e0-4e8c-8af8-53f0e85001b6.png" style="width: 44px; height: 45px; margin: 0px 5px 0px 0px;" width="44">
</a>
<a href="http://app.climb.social/" target="_blank">
<img align="none" height="44" src="https://gallery.mailchimp.com/4ca7b1922d93f327ebc560d44/images/80a7d134-7356-4d45-b516-6dabab38efaf.png" style="width: 45px; height: 44px; margin: 0px 0px 0px 5px;" width="45">
</a>
</p>
<span style="font-size:10px">You have received this email because you signed up for a 30-day trial at Climb.social.
<br> If that wasn't you, please reply to this message and let us know.</span>
</td>
</tr>
</tbody>
</table>

</td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="mcnCodeBlock">
<tbody class="mcnTextBlockOuter">
<tr>
<td valign="top" class="mcnTextBlockInner">
<div class="mcnTextContent">
{{ unsubscribe_link }}
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
<!--[if gte mso 9]>
</td>
</tr>
</table>
<![endif]-->
</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</body>
</html>
Loading

0 comments on commit 3b549e2

Please sign in to comment.