From 12cd6e6a5445a72c7e9f5efe5e9505e400f89389 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 5 Jun 2017 23:11:48 -0400 Subject: mail --- lib/awmail/index.js | 13 ++++++++++++- templates/email.html | 8 +++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/lib/awmail/index.js b/lib/awmail/index.js index f7a758b..e516a44 100644 --- a/lib/awmail/index.js +++ b/lib/awmail/index.js @@ -45,6 +45,9 @@ function AWMail (options) { { name: 'lines', maxCount: 1 }, { name: 'plain', maxCount: 1 }, ]) + + var logoImage = fs.readFileSync('../../public/assets/img/logo.png') + var armoryImage = fs.readFileSync('../../public/assets/img/armory.png') router.post('/send', multerMiddleware, function (req, res) { res.header('Access-Control-Allow-Origin', '*') @@ -218,13 +221,21 @@ function AWMail (options) { image.path = 'face.jpg' image.end(content.image.buffer) + var logo = new PassThrough() + logo.path = 'logo.jpg' + logo.end(logoImage) + + var armory = new PassThrough() + armory.path = 'armory.jpg' + armory.end(armoryImage) + return mg.messages.create(config.domain, { from: config.from, to: [content.email], subject: config.subject, text: content.text, html: content.html, - inline: [image], + inline: [image, logo, armory], }) } diff --git a/templates/email.html b/templates/email.html index fe786f7..ea91352 100644 --- a/templates/email.html +++ b/templates/email.html @@ -1,7 +1,9 @@ -Thank you for visiting Hansel and Gretel at the Armory. +
+

- +

Download your photo

- + +
\ No newline at end of file -- cgit v1.2.3-70-g09d2