2015-07-29 11:04:38 +02:00
|
|
|
var mail = require('../../lib/mail.js');
|
|
|
|
var Log = require('../../lib/NodeLog.js');
|
|
|
|
|
|
|
|
module.exports.index = function(req, res) {
|
|
|
|
|
|
|
|
var text = '';
|
|
|
|
|
|
|
|
for (var i in req.body) {
|
2015-08-25 14:03:01 +02:00
|
|
|
text += i + ' : ' + req.body[i] + '\n';
|
2015-07-29 11:04:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
mail.send({
|
|
|
|
from: req.session.user_id + " <" + req.session.user_id + "@toto.tata>",
|
2015-08-03 00:00:07 +02:00
|
|
|
to: "Thomas <dragonrock.django@gmail.com>",
|
2015-07-29 11:04:38 +02:00
|
|
|
subject: "By " + req.session.user_id,
|
|
|
|
text: text
|
|
|
|
}, function(err, message) {
|
|
|
|
if (err !== null) {
|
|
|
|
Log.mailerror(err);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
res.redirect('/thankyou');
|
|
|
|
|
|
|
|
};
|