mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-05-03 01:14:46 -04:00
Added task text and candidate name to task emails
This commit is contained in:
parent
ac7e663418
commit
37b8790b58
1 changed files with 23 additions and 19 deletions
|
@ -479,26 +479,30 @@ sendUserRemarkTaskEmail = (task, cb) ->
|
||||||
mailTaskName = @mailTaskName
|
mailTaskName = @mailTaskName
|
||||||
User.findOne("_id":task.contact).select("email").lean().exec (err, contact) ->
|
User.findOne("_id":task.contact).select("email").lean().exec (err, contact) ->
|
||||||
if err? then return cb err
|
if err? then return cb err
|
||||||
context =
|
User.findOne("_id":task.user).select("jobProfile.name").lean().exec (err, user) ->
|
||||||
email_id: "tem_aryDjyw6JmEmbKtCMTSwAM"
|
|
||||||
recipient:
|
|
||||||
address: contact.email
|
|
||||||
email_data:
|
|
||||||
candidate_link: "http://codecombat.com/account/profile/#{task.user}"
|
|
||||||
due_date: task.date
|
|
||||||
log.info "Sending recruitment task reminder to #{contact.email}"
|
|
||||||
newSentMail =
|
|
||||||
mailTask: mailTaskName
|
|
||||||
user: task.contact
|
|
||||||
"metadata":
|
|
||||||
remarkID: task.remarkID
|
|
||||||
taskAction: task.action
|
|
||||||
date: task.date
|
|
||||||
MailSent.create newSentMail, (err) ->
|
|
||||||
if err? then return cb err
|
if err? then return cb err
|
||||||
sendwithus.api.send context, (err, result) ->
|
context =
|
||||||
log.error "Error sending #{mailTaskName} to #{contact.email}: #{err} with result #{result}" if err
|
email_id: "tem_aryDjyw6JmEmbKtCMTSwAM"
|
||||||
cb null
|
recipient:
|
||||||
|
address: contact.email
|
||||||
|
email_data:
|
||||||
|
task_text: task.action
|
||||||
|
candidate_name: user.jobProfile?.name ? "(Name not listed in job profile)"
|
||||||
|
candidate_link: "http://codecombat.com/account/profile/#{task.user}"
|
||||||
|
due_date: task.date
|
||||||
|
log.info "Sending recruitment task reminder to #{contact.email}"
|
||||||
|
newSentMail =
|
||||||
|
mailTask: mailTaskName
|
||||||
|
user: task.contact
|
||||||
|
"metadata":
|
||||||
|
remarkID: task.remarkID
|
||||||
|
taskAction: task.action
|
||||||
|
date: task.date
|
||||||
|
MailSent.create newSentMail, (err) ->
|
||||||
|
if err? then return cb err
|
||||||
|
sendwithus.api.send context, (err, result) ->
|
||||||
|
log.error "Error sending #{mailTaskName} to #{contact.email}: #{err} with result #{result}" if err
|
||||||
|
cb null
|
||||||
|
|
||||||
### New Recruit Leaderboard Email ###
|
### New Recruit Leaderboard Email ###
|
||||||
###
|
###
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue