Big commit
This commit is contained in:
25
posts/feedback-target/index.js
Normal file
25
posts/feedback-target/index.js
Normal file
@@ -0,0 +1,25 @@
|
||||
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) {
|
||||
text += i + ' : ' + req.body[i] + '\n'
|
||||
}
|
||||
|
||||
mail.send({
|
||||
from: req.session.user_id + " <" + req.session.user_id + "@toto.tata>",
|
||||
to: "Thomas <thomas.forgione@gmail.com>",
|
||||
subject: "By " + req.session.user_id,
|
||||
text: text
|
||||
}, function(err, message) {
|
||||
if (err !== null) {
|
||||
Log.mailerror(err);
|
||||
}
|
||||
});
|
||||
|
||||
res.redirect('/thankyou');
|
||||
|
||||
};
|
||||
3
posts/feedback-target/urls.js
Normal file
3
posts/feedback-target/urls.js
Normal file
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
'/feedback-target': 'index'
|
||||
};
|
||||
@@ -30,7 +30,7 @@ module.exports.index = function(req, res) {
|
||||
);
|
||||
});
|
||||
|
||||
res.redirect('/');
|
||||
res.redirect('/prototype/tutorial');
|
||||
|
||||
});
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user