Better mail (easier to treat automatically)

This commit is contained in:
Thomas FORGIONE 2015-10-06 13:48:58 +02:00
parent cc4755cf9d
commit 1daf627232
1 changed files with 8 additions and 6 deletions

View File

@ -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 <dragonrock.django@gmail.com>",