From 3f77a00870c1e1499d15a7fc7671eb9886ad55d7 Mon Sep 17 00:00:00 2001 From: Mark Moser Date: Thu, 15 Sep 2016 13:40:43 -0500 Subject: [PATCH] remove hard coded review email addresses --- app/mailers/reviewer_mailer.rb | 9 +-------- test/mailers/reviewer_mailer_test.rb | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/app/mailers/reviewer_mailer.rb b/app/mailers/reviewer_mailer.rb index b4eee1b..0f06024 100644 --- a/app/mailers/reviewer_mailer.rb +++ b/app/mailers/reviewer_mailer.rb @@ -2,14 +2,7 @@ class ReviewerMailer < ApplicationMailer def candidate_submission candidate @candidate = candidate - - # TODO: candidate.reviewers.map(:email) - if Rails.env.production? - recipients = ["harish.bhavanichikar@perficient.com", "jacob.schulke@perficient.com", - "jennifer.siegfried@perficient.com", "martin.ridgway@perficient.com"] - else - recipients = ["fed.reviewer@mailinator.com"] - end + recipients = candidate.quiz.reviewers.map(&:email) mail to: recipients, subject: "Skills Assessment Results" end diff --git a/test/mailers/reviewer_mailer_test.rb b/test/mailers/reviewer_mailer_test.rb index 45bb811..6241752 100644 --- a/test/mailers/reviewer_mailer_test.rb +++ b/test/mailers/reviewer_mailer_test.rb @@ -6,7 +6,7 @@ class ReviewerMailerTest < ActionMailer::TestCase candidate = candidates :dawn mail = ReviewerMailer.candidate_submission candidate assert_match "Results", mail.subject - # assert_equal [candidate.recruiter.email], mail.to + assert_equal candidate.quiz.reviewers.map(&:email), mail.to assert_equal [ENV["default_mail_from"]], mail.from assert_match candidate.test_hash, mail.body.encoded end