From 1daf627232cb186e7465bf958c43bb3ab2321ed4 Mon Sep 17 00:00:00 2001 From: Thomas FORGIONE Date: Tue, 6 Oct 2015 13:48:58 +0200 Subject: [PATCH] Better mail (easier to treat automatically) --- posts/feedback-target/index.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/posts/feedback-target/index.js b/posts/feedback-target/index.js index aa8030b..60623dc 100644 --- a/posts/feedback-target/index.js +++ b/posts/feedback-target/index.js @@ -6,12 +6,7 @@ var Log = require('../../lib/NodeLog.js'); module.exports.index = function(req, res) { - var text = ''; - - for (var i in req.body) { - text += i + ' : ' + req.body[i] + '\n'; - } - + var text = 'id : ' + req.session.userId + '\n'; pg.connect(pgc.url, function(err, client, release) { @@ -20,6 +15,13 @@ module.exports.index = function(req, res) { [req.session.userId], function(err, result) { + + text += 'workerId : ' + result.rows[0].name + '\n'; + + for (var i in req.body) { + text += i + ' : ' + req.body[i] + '\n'; + } + mail.send({ from: result.rows[0].name + " <" + req.session.userId + "@toto.tata>", to: "Thomas ",