recruiter mailer
This commit is contained in:
parent
78238e6d72
commit
4136db4aab
13
app/mailers/recruiter_mailer.rb
Normal file
13
app/mailers/recruiter_mailer.rb
Normal 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
|
24
app/views/recruiter_mailer/candidate_created.html.erb
Normal file
24
app/views/recruiter_mailer/candidate_created.html.erb
Normal 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>
|
10
app/views/recruiter_mailer/candidate_created.text.erb
Normal file
10
app/views/recruiter_mailer/candidate_created.text.erb
Normal 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.
|
17
app/views/recruiter_mailer/candidate_submitted.html.erb
Normal file
17
app/views/recruiter_mailer/candidate_submitted.html.erb
Normal 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>
|
4
app/views/recruiter_mailer/candidate_submitted.text.erb
Normal file
4
app/views/recruiter_mailer/candidate_submitted.text.erb
Normal 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.
|
10
test/mailers/previews/recruiter_mailer_preview.rb
Normal file
10
test/mailers/previews/recruiter_mailer_preview.rb
Normal 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
|
21
test/mailers/recruiter_mailer_test.rb
Normal file
21
test/mailers/recruiter_mailer_test.rb
Normal 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
|
Loading…
Reference in New Issue
Block a user