reviewer reminders

This commit is contained in:
Mark Moser 2017-02-08 17:57:25 -06:00
parent bf6c686e2e
commit 117b795a0c
5 changed files with 36 additions and 0 deletions

View File

@ -6,4 +6,10 @@ class ReviewerMailer < ApplicationMailer
mail to: recipients, subject: "Skills Assessment Results - #{@candidate.test_hash}"
end
def reminder reminder
@reminder = reminder
mail to: reminder.email, subject: "Review Reminder"
end
end

View File

@ -0,0 +1,9 @@
<row>
<columns class="email-body">
<p>Hello <%= @reminder.name %>,</p>
<p>
Please review and vote on the results for <%= link_to nil, admin_result_url(@reminder.test_hash) %>
</p>
</columns>
</row>

View File

@ -0,0 +1,5 @@
PERFICIENT/digital SKILLS ASSESSMENT RESULTS
Hello <%= @reminder.name %>,
Please review and vote on the results for <%= admin_result_url(@reminder.test_hash) %>.

View File

@ -4,4 +4,10 @@ class ReviewerMailerPreview < ActionMailer::Preview
def candidate_submission
ReviewerMailer.candidate_submission Candidate.find_by(test_hash: 'OvP0ZqGKwJ0') # Dawn
end
def reminder
reminders = ReviewerReminder.new
reminder = reminders.reminders.first
ReviewerMailer.reminder reminder
end
end

View File

@ -11,4 +11,14 @@ class ReviewerMailerTest < ActionMailer::TestCase
assert_equal [ENV["default_mail_from"]], mail.from
assert_match candidate.test_hash, mail.body.encoded
end
test "reminder" do
reminders = ReviewerReminder.new
reminder = reminders.reminders.first
mail = ReviewerMailer.reminder reminder
assert_match "Review Reminder", mail.subject
assert_equal [reminder.email], mail.to
assert_equal [ENV["default_mail_from"]], mail.from
assert_match reminder.test_hash, mail.body.encoded
end
end