recruiter notification on interview status change re: #85
This commit is contained in:
@ -32,27 +32,31 @@ module Admin
|
||||
def approve
|
||||
@candidate = Candidate.find_by(test_hash: params[:test_hash])
|
||||
authorize ReviewerVote.find_by(user_id: current_user.id, candidate_id: @candidate.id)
|
||||
current_user.approve_candidate(@candidate)
|
||||
|
||||
results = {
|
||||
message: "Interview requested!",
|
||||
requestCopy: "Requested",
|
||||
declineCopy: "Decline Interview"
|
||||
}
|
||||
render json: results.to_json
|
||||
if current_user.approve_candidate(@candidate)
|
||||
RecruiterMailer.interview_requested(@candidate).deliver_later
|
||||
results = {
|
||||
message: "Interview requested!",
|
||||
requestCopy: "Requested",
|
||||
declineCopy: "Decline Interview"
|
||||
}
|
||||
render json: results.to_json
|
||||
end
|
||||
end
|
||||
|
||||
def decline
|
||||
@candidate = Candidate.find_by(test_hash: params[:test_hash])
|
||||
authorize ReviewerVote.find_by(user_id: current_user.id, candidate_id: @candidate.id)
|
||||
current_user.decline_candidate(@candidate)
|
||||
|
||||
results = {
|
||||
message: "Interview declined.",
|
||||
requestCopy: "Request Interview",
|
||||
declineCopy: "Declined"
|
||||
}
|
||||
render json: results.to_json
|
||||
if current_user.decline_candidate(@candidate)
|
||||
RecruiterMailer.interview_declined(@candidate).deliver_later
|
||||
results = {
|
||||
message: "Interview declined.",
|
||||
requestCopy: "Request Interview",
|
||||
declineCopy: "Declined"
|
||||
}
|
||||
render json: results.to_json
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -3,12 +3,28 @@ class RecruiterMailer < ApplicationMailer
|
||||
def candidate_created candidate
|
||||
@candidate = candidate
|
||||
|
||||
mail to: @candidate.recruiter.email, subject: "Skills Assessment Test - #{candidate.name}"
|
||||
mail to: @candidate.recruiter.email,
|
||||
subject: "Skills Assessment Test - #{candidate.name}"
|
||||
end
|
||||
|
||||
def candidate_submitted candidate
|
||||
@candidate = candidate
|
||||
|
||||
mail to: @candidate.recruiter.email, subject: "Skills Assessment Test - #{candidate.name}"
|
||||
mail to: @candidate.recruiter.email,
|
||||
subject: "Skills Assessment Test - #{candidate.name}"
|
||||
end
|
||||
|
||||
def interview_requested candidate
|
||||
@candidate = candidate
|
||||
|
||||
mail to: @candidate.recruiter.email,
|
||||
subject: "Skills Assesment - Interview Request for #{candidate.name}"
|
||||
end
|
||||
|
||||
def interview_declined candidate
|
||||
@candidate = candidate
|
||||
|
||||
mail to: @candidate.recruiter.email,
|
||||
subject: "Skills Assesment - Interview Declined for #{candidate.name}"
|
||||
end
|
||||
end
|
||||
|
6
app/views/recruiter_mailer/interview_declined.html.inky
Normal file
6
app/views/recruiter_mailer/interview_declined.html.inky
Normal file
@ -0,0 +1,6 @@
|
||||
<row>
|
||||
<columns class="email-body">
|
||||
<p>The team has declined an interview with <strong><%= @candidate.name %></strong>.</p>
|
||||
<p>Thank you</p>
|
||||
</columns>
|
||||
</row>
|
5
app/views/recruiter_mailer/interview_declined.text.erb
Normal file
5
app/views/recruiter_mailer/interview_declined.text.erb
Normal file
@ -0,0 +1,5 @@
|
||||
PERFICIENT/digital - Skills Assessment Test
|
||||
|
||||
The team has declined an interview with <%= @candidate.name %>.
|
||||
|
||||
Thank you.
|
6
app/views/recruiter_mailer/interview_requested.html.inky
Normal file
6
app/views/recruiter_mailer/interview_requested.html.inky
Normal file
@ -0,0 +1,6 @@
|
||||
<row>
|
||||
<columns class="email-body">
|
||||
<p>The team has requested an interview with <strong><%= @candidate.name %></strong>.</p>
|
||||
<p>Thank you</p>
|
||||
</columns>
|
||||
</row>
|
5
app/views/recruiter_mailer/interview_requested.text.erb
Normal file
5
app/views/recruiter_mailer/interview_requested.text.erb
Normal file
@ -0,0 +1,5 @@
|
||||
PERFICIENT/digital - Skills Assessment Test
|
||||
|
||||
The team has requested an interview with <%= @candidate.name %>.
|
||||
|
||||
Thank you.
|
Reference in New Issue
Block a user