aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/routes/transactions.coffee17
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(
+ 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)