From 470076fd88e4035b2ce1bf48e1adff9fae4f5a2f Mon Sep 17 00:00:00 2001 From: Dennis Eriksen Date: Tue, 14 May 2013 09:36:18 +0200 Subject: experimenting with emailjs --- controllers/system.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'controllers') 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 ', + 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) { -- cgit v1.2.3