overleaf/services/web/app/coffee/Features/Email/EmailHandler.coffee

14 lines
434 B
CoffeeScript
Raw Normal View History

settings = require("settings-sharelatex")
EmailBuilder = require "./EmailBuilder"
EmailSender = require "./EmailSender"
module.exports =
2014-03-05 09:56:52 -05:00
sendEmail : (emailType, opts, callback = (err)->)->
email = EmailBuilder.buildEmail emailType, opts
if email.type == "lifecycle" and !settings.email.lifecycle
return callback()
opts.html = email.html
opts.subject = email.subject
EmailSender.sendEmail opts, (err)->
callback(err)