mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-30 19:06:59 -05:00
Came up with a better hacky logging system.
This commit is contained in:
parent
c59b9d904b
commit
b2366c50af
1 changed files with 2 additions and 9 deletions
|
@ -2,18 +2,11 @@ mail = require '../commons/mail'
|
||||||
map = _.invert mail.MAILCHIMP_GROUP_MAP
|
map = _.invert mail.MAILCHIMP_GROUP_MAP
|
||||||
User = require '../users/User.coffee'
|
User = require '../users/User.coffee'
|
||||||
errors = require '../commons/errors'
|
errors = require '../commons/errors'
|
||||||
|
request = require 'request'
|
||||||
options =
|
|
||||||
from: 'scott@codecombat.com'
|
|
||||||
to: 'scott@codecombat.com'
|
|
||||||
replyTo: 'scott@codecombat.com'
|
|
||||||
subject: 'Bad log'
|
|
||||||
text: ''
|
|
||||||
|
|
||||||
badLog = (text) ->
|
badLog = (text) ->
|
||||||
options.text = text
|
options.text = text
|
||||||
mail.transport.sendMail options, (error) ->
|
request.post 'http://requestb.in/1brdpaz1', { form: {log: text} }
|
||||||
console.error "Error sending mail: #{error.message or error}" if error
|
|
||||||
|
|
||||||
module.exports.setupRoutes = (app) ->
|
module.exports.setupRoutes = (app) ->
|
||||||
app.all '/mail/webhook', (req, res) ->
|
app.all '/mail/webhook', (req, res) ->
|
||||||
|
|
Loading…
Reference in a new issue