mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
added null checks into email sender for from address
This commit is contained in:
parent
32f9e33f71
commit
e433eca157
1 changed files with 5 additions and 1 deletions
|
@ -4,6 +4,10 @@ Settings = require('settings-sharelatex')
|
|||
metrics = require("../../infrastructure/Metrics")
|
||||
ses = require('node-ses')
|
||||
|
||||
if Settings.email? and Settings.email.fromAddress?
|
||||
defaultFromAddress = ""
|
||||
else
|
||||
defaultFromAddress = Settings.email.fromAddress
|
||||
|
||||
if Settings.email?.ses? and Settings.email.ses?.key? and Settings.email.ses?.key != "" and Settings.email.ses?.secret? and Settings.email.ses?.secret != ""
|
||||
client = ses.createClient({ key: Settings.email.ses.key, secret: Settings.email.ses.secret });
|
||||
|
@ -21,7 +25,7 @@ module.exports =
|
|||
metrics.inc "email"
|
||||
options =
|
||||
to: options.to
|
||||
from: Settings.email.fromAddress
|
||||
from: defaultFromAddress
|
||||
subject: options.subject
|
||||
message: options.html
|
||||
replyTo: options.replyTo || Settings.email.replyToAddress
|
||||
|
|
Loading…
Reference in a new issue