diff options
| author | Adam Soltys <[email protected]> | 2016-09-18 15:55:47 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2016-09-18 15:55:47 -0700 |
| commit | 11d8decbb3b444561ee51daa0f0d2a609da13e47 (patch) | |
| tree | 27176229e447f47dad06689e7d96dd3bc6012cda /src | |
| parent | 90da658fe477005ad8ab140d205b0d0e1dce00ea (diff) | |
| download | coinos-server-11d8decbb3b444561ee51daa0f0d2a609da13e47.tar.gz coinos-server-11d8decbb3b444561ee51daa0f0d2a609da13e47.zip | |
Send basic notification on transaction receipt
Diffstat (limited to 'src')
| -rw-r--r-- | src/routes/transactions.coffee | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/routes/transactions.coffee b/src/routes/transactions.coffee index 25ccbbc9..cadb73b1 100644 --- a/src/routes/transactions.coffee +++ b/src/routes/transactions.coffee @@ -46,6 +46,23 @@ module.exports = db.exists(req.body.txid, (err, result) -> return finish() if result + res.render('notification', + layout: 'mail', + js: (-> global.js), + css: (-> global.css), + (err, html) -> + sendgrid = require('sendgrid')(config.sendgrid_user, config.sendgrid_password) + + email = new sendgrid.Email( + to: '[email protected]' + from: '[email protected]' + subject: 'Transaction Sent' + html: html + ) + + sendgrid.send(email) + ) + multi = db.multi() multi.hmset(req.body.txid, req.body) multi.rpush("#{req.params.user}:transactions", req.body.txid) |
