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 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'lib') 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], }) } -- cgit v1.2.3-70-g09d2