mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-30 15:45:03 -05:00
20 lines
525 B
CoffeeScript
20 lines
525 B
CoffeeScript
settings = require("settings-sharelatex")
|
|
EmailBuilder = require "./EmailBuilder"
|
|
EmailSender = require "./EmailSender"
|
|
|
|
if !settings.email?
|
|
settings.email =
|
|
lifecycleEnabled:false
|
|
|
|
|
|
module.exports =
|
|
|
|
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.text = email.text
|
|
opts.subject = email.subject
|
|
EmailSender.sendEmail opts, (err)->
|
|
callback(err)
|