diff options
Diffstat (limited to 'lib/awmail/index.js')
| -rw-r--r-- | lib/awmail/index.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/awmail/index.js b/lib/awmail/index.js index f7a758b..814e544 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', '*') @@ -166,7 +169,6 @@ function AWMail (options) { }).catch(function(err){ console.log(err) }) - res.sendStatus(200) }) @@ -218,13 +220,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], }) } |
