recruiter mailer

This commit is contained in:
Mark Moser 2016-08-02 10:35:33 -05:00
parent 78238e6d72
commit 4136db4aab
7 changed files with 99 additions and 0 deletions

View File

@ -0,0 +1,13 @@
class RecruiterMailer < ApplicationMailer
def candidate_created candidate
@candidate = candidate
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}"
end
end

View File

@ -0,0 +1,24 @@
<table cellspacing="0" cellpadding="0" border="0" style="width:100%; font-family:sans-serif;">
<tr>
<td style="background-color:#cc0c0d; color:#ffffff; padding:15px 20px;">
PERFICIENT DIGITAL - Skills Assessment Test
</td>
</tr>
<tr>
<td style="padding:50px;">
<p>The following candidate has been invited to take the Skills Assessment Test:</p>
<p>
<strong>Candidate Name:</strong> <%= @candidate.name %><br />
<strong>Candidate Email:</strong> <%= @candidate.email %><br />
<strong>Candidate ID:</strong> <%= @candidate.test_hash %><br />
<strong>Years of Experience:</strong> <%= @candidate.experience %> Years<br />
</p>
<p>You will be notified when the candidate has finished taking the test.</p>
</td>
</tr>
</table>

View File

@ -0,0 +1,10 @@
PERFICIENT DIGITAL - Skills Assessment Test
The following candidate has been invited to take the Skills Assessment Test:
Candidate Name: <%= @candidate.name %>
Candidate Email: <%= @candidate.email %>
Candidate ID: <%= @candidate.test_hash %>
Years of Experience: <%= @candidate.experience %> Years
You will be notified when the candidate has finished taking the test.

View File

@ -0,0 +1,17 @@
<table cellspacing="0" cellpadding="0" border="0" style="width:100%; font-family:sans-serif;">
<tr>
<td style="background-color:#cc0c0d; color:#ffffff; padding:15px 20px;">
PERFICIENT DIGITAL - Skills Assessment Test
</td>
</tr>
<tr>
<td style="padding:50px;">
<p><%= @candidate.name %> has completed the Skills Assessment Test.</p>
<p>Martin Ridgway will let you know if we would like to interview this candidate.</p>
</td>
</tr>
</table>

View File

@ -0,0 +1,4 @@
PERFICIENT DIGITAL - Skills Assessment Test
<%= @candidate.name %> has completed the Skills Assessment Test.
Martin Ridgway will let you know if we would like to interview this candidate.

View File

@ -0,0 +1,10 @@
# Preview all emails at http://localhost:3000/rails/mailers/recruiter_mailer
class RecruiterMailerPreview < ActionMailer::Preview
def candidate_created
RecruiterMailer.candidate_created Candidate.find_by(test_hash: 'R67PmfDHGiw') # Martha
end
def candidate_submitted
RecruiterMailer.candidate_submitted Candidate.find_by(test_hash: 'OvP0ZqGKwJ0') # Dawn
end
end

View File

@ -0,0 +1,21 @@
require 'test_helper'
class RecruiterMailerTest < ActionMailer::TestCase
test "candidate_created" do
candidate = candidates :martha
mail = RecruiterMailer.candidate_created candidate
assert_match candidate.name, mail.subject
assert_equal [candidate.recruiter.email], mail.to
assert_equal [ENV["default_mail_from"]], mail.from
assert_match candidate.test_hash, mail.body.encoded
end
test "candidate_submitted" do
candidate = candidates :dawn
mail = RecruiterMailer.candidate_submitted candidate
assert_match candidate.name, mail.subject
assert_equal [candidate.recruiter.email], mail.to
assert_equal [ENV["default_mail_from"]], mail.from
assert_match candidate.name, mail.body.encoded
end
end