diff --git a/app/mailers/reviewer_mailer.rb b/app/mailers/reviewer_mailer.rb index 9d57d89..7b467b4 100644 --- a/app/mailers/reviewer_mailer.rb +++ b/app/mailers/reviewer_mailer.rb @@ -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 diff --git a/app/views/reviewer_mailer/reminder.html.inky b/app/views/reviewer_mailer/reminder.html.inky new file mode 100644 index 0000000..af7cfc8 --- /dev/null +++ b/app/views/reviewer_mailer/reminder.html.inky @@ -0,0 +1,9 @@ + + +

Hello <%= @reminder.name %>,

+

+ Please review and vote on the results for <%= link_to nil, admin_result_url(@reminder.test_hash) %> +

+
+
+ diff --git a/app/views/reviewer_mailer/reminder.text.erb b/app/views/reviewer_mailer/reminder.text.erb new file mode 100644 index 0000000..ef651e0 --- /dev/null +++ b/app/views/reviewer_mailer/reminder.text.erb @@ -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) %>. diff --git a/test/mailers/previews/reviewer_mailer_preview.rb b/test/mailers/previews/reviewer_mailer_preview.rb index df8b1cb..bc7f97e 100644 --- a/test/mailers/previews/reviewer_mailer_preview.rb +++ b/test/mailers/previews/reviewer_mailer_preview.rb @@ -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 diff --git a/test/mailers/reviewer_mailer_test.rb b/test/mailers/reviewer_mailer_test.rb index 35673eb..f02c068 100644 --- a/test/mailers/reviewer_mailer_test.rb +++ b/test/mailers/reviewer_mailer_test.rb @@ -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