Added mail thing

This commit is contained in:
Thomas FORGIONE
2015-07-17 14:53:45 +02:00
parent f32ffe9b01
commit 0fb63b93f6
8 changed files with 264 additions and 170 deletions

19
posts/coin-info/index.js Normal file
View File

@@ -0,0 +1,19 @@
var mail = require('../../lib/mail.js');
var Log = require('../../lib/NodeLog.js');
module.exports.index = function(req, res) {
mail.send({
from: req.body.name + " <dragonrock.django@gmail.com>",
to: "Thomas <thomas.forgione@gmail.com>",
subject: req.body.scene,
text: JSON.stringify(req.body.coins)
}, function(err, message) {
if (err !== null) {
Log.mailerror(err);
}
});
res.setHeader('Content-Type', 'text/html');
res.send("");
};

3
posts/coin-info/urls.js Normal file
View File

@@ -0,0 +1,3 @@
module.exports = {
'/coin-info': 'index'
};