aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/controllers
diff options
context:
space:
mode:
authorDennis Eriksen <dennis.se@gmail.com>2013-05-14 09:36:18 +0200
committerDennis Eriksen <dennis.se@gmail.com>2013-05-14 09:36:18 +0200
commit470076fd88e4035b2ce1bf48e1adff9fae4f5a2f (patch)
tree3adc3f205dc4215283b10ea75ce6f0f1e77ab1d8 /controllers
parentadded email settings, and changed some quotes for the sake of pretty. (diff)
downloadDivid-470076fd88e4035b2ce1bf48e1adff9fae4f5a2f.tar.gz
experimenting with emailjs
Diffstat (limited to 'controllers')
-rw-r--r--controllers/system.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/controllers/system.js b/controllers/system.js
index 8c0c623..462641f 100644
--- a/controllers/system.js
+++ b/controllers/system.js
@@ -3,6 +3,8 @@
* Module dependencies
*/
var mongoose = require('mongoose')
+ , env = process.env.NODE_ENV || 'development'
+ , config = require('../config/config.js')[env]
, Project = mongoose.model('Project')
, Access = mongoose.model('Access')
, User = mongoose.model('User')
@@ -119,7 +121,21 @@ exports.projectParticipants = function(req, res) {
}
exports.postProjectParticipants = function(req, res) {
+ var email = require('emailjs');
+ var server = email.server.connect(config.email);
+ console.log(server);
+
+ var message = {
+ text: 'lol',
+ from: 'Divid <divid@divid.no>',
+ to: 'dennis.se@gmail.com',
+ subject: 'test'
+ }
+
+ server.send(message, function(err, message) { console.log(err || message);});
+
+ res.redirect('back');
}
exports.projectPost = function(req, res) {