Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

moved the postman object from mailer.coffee to helpers.coffee

  • Loading branch information...
commit 31459c98b3edb34d73941c03c1606be3c8b024df 1 parent 12e96ca
@paulbjensen paulbjensen authored
View
1  internals.coffee
@@ -10,7 +10,6 @@ app =
app.config = require('./server/config')[ss.env]
require("#{__dirname}/server/db.coffee") app
-require("#{__dirname}/server/mailer.coffee") app
require("#{__dirname}/server/helpers.coffee") app
require("#{__dirname}/server/controllers/dashboard.coffee") app
View
7 server/helpers.coffee
@@ -1,3 +1,5 @@
+nodemailer = require 'nodemailer'
+
#### HELPERS ####
module.exports = (app) ->
@@ -8,4 +10,7 @@ module.exports = (app) ->
if !err and user?
next user
else
- res status: 'failure', reason: err || "User not found"
+ res status: 'failure', reason: err || "User not found"
+
+ # Setup the global mail transport
+ app.helpers.postman = nodemailer.createTransport app.config.mail.type, app.config.mail.options
View
6 server/mailer.coffee
@@ -1,6 +0,0 @@
-nodemailer = require 'nodemailer'
-
-module.exports = (app) ->
-
- # Setup the global mail transport
- app.postman = nodemailer.createTransport app.config.mail.type, app.config.mail.options
View
2  server/rpc/authentication.coffee
@@ -6,9 +6,9 @@ uuid = require 'node-uuid'
User = ss.api.app.models.User
Dashboard = ss.api.app.models.Dashboard
Redis = ss.api.app.Redis
-postman = ss.api.app.postman
config = ss.api.app.config
fetchUserFromSession = ss.api.app.helpers.fetchUserFromSession
+postman = ss.api.app.helpers.postman
forgottenPasswordEmailText = (link) -> "Hi,
\n
View
2  test/server/rpc/authentication_test.coffee
@@ -9,7 +9,7 @@ ss = require "socketstream"
internals = require "../../../internals.coffee"
config = require "../../../server/config.coffee"
-postman = ss.api.app.postman
+postman = ss.api.app.helpers.postman
User = ss.api.app.models.User
Dashboard = ss.api.app.models.Dashboard
Redis = ss.api.app.Redis
View
2  test/server/rpc/dashboard_test.coffee
@@ -5,7 +5,7 @@ ss = require 'socketstream'
internals = require "../../../internals.coffee"
config = require "../../../server/config.coffee"
-postman = ss.api.app.postman
+postman = ss.api.app.helpers.postman
User = ss.api.app.models.User
Dashboard = ss.api.app.models.Dashboard
Redis = ss.api.app.Redis
Please sign in to comment.
Something went wrong with that request. Please try again.