Added task text and candidate name to task emails

This commit is contained in:
Michael Schmatz 2014-07-21 08:02:53 -07:00
parent ac7e663418
commit 37b8790b58

View file

@ -478,12 +478,16 @@ taskReminderAlreadySentThisWeekFilter = (task, cb) ->
sendUserRemarkTaskEmail = (task, cb) ->
mailTaskName = @mailTaskName
User.findOne("_id":task.contact).select("email").lean().exec (err, contact) ->
if err? then return cb err
User.findOne("_id":task.user).select("jobProfile.name").lean().exec (err, user) ->
if err? then return cb err
context =
email_id: "tem_aryDjyw6JmEmbKtCMTSwAM"
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}"