mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-12-12 00:31:21 -05:00
Merge branch 'master' into production
This commit is contained in:
commit
f43012c7a6
3 changed files with 5 additions and 5 deletions
|
@ -19,10 +19,10 @@ module.exports = class User extends CocoModel
|
|||
displayName: -> @get('name', true)
|
||||
broadName: ->
|
||||
return '(deleted)' if @get('deleted')
|
||||
name = @get('name')
|
||||
return name if name
|
||||
name = _.filter([@get('firstName'), @get('lastName')]).join(' ')
|
||||
return name if name
|
||||
name = @get('name')
|
||||
return name if name
|
||||
[emailName, emailDomain] = @get('email')?.split('@') or []
|
||||
return emailName if emailName
|
||||
return 'Anonymous'
|
||||
|
|
|
@ -44,10 +44,10 @@ UserSchema.post('init', ->
|
|||
|
||||
UserSchema.methods.broadName = ->
|
||||
return '(deleted)' if @get('deleted')
|
||||
name = @get('name')
|
||||
return name if name
|
||||
name = _.filter([@get('firstName'), @get('lastName')]).join(' ')
|
||||
return name if name
|
||||
name = @get('name')
|
||||
return name if name
|
||||
[emailName, emailDomain] = @get('email').split('@')
|
||||
return emailName if emailName
|
||||
return 'Anonymous'
|
||||
|
|
|
@ -14,7 +14,7 @@ module.exports.setup = (app) ->
|
|||
# log.info "Sending mail from #{req.body.email} saying #{req.body.message}"
|
||||
fromAddress = req.body.sender or req.body.email or req.user.get('email')
|
||||
createMailContent req, fromAddress, (subject, content) ->
|
||||
if req.body.licensesNeeded or req.user.isTeacher()
|
||||
if (req.body.licensesNeeded or req.user.isTeacher()) and subject.indexOf('Level Load Error:') < 0
|
||||
closeIO.getSalesContactEmail fromAddress, (err, salesContactEmail, userID, leadID) ->
|
||||
return log.error("Error getting sales contact for #{fromAddress}: #{err.message or err}") if err
|
||||
closeIO.sendMail fromAddress, subject, content, salesContactEmail, leadID, (err) ->
|
||||
|
|
Loading…
Reference in a new issue