candidate mailer
This commit is contained in:
parent
f7ec6ee84f
commit
78238e6d72
19
app/mailers/candidate_mailer.rb
Normal file
19
app/mailers/candidate_mailer.rb
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
class CandidateMailer < ApplicationMailer
|
||||||
|
def welcome candidate
|
||||||
|
@candidate = candidate
|
||||||
|
|
||||||
|
mail to: @candidate.email, subject: "Perficient Digital - Skills Assessment Test"
|
||||||
|
end
|
||||||
|
|
||||||
|
def reminder candidate
|
||||||
|
@candidate = candidate
|
||||||
|
|
||||||
|
mail to: @candidate.email, subject: "Perficient Digital - Skills Assessment Test"
|
||||||
|
end
|
||||||
|
|
||||||
|
def submitted candidate
|
||||||
|
@candidate = candidate
|
||||||
|
|
||||||
|
mail to: @candidate.email, subject: "Perficient Digital - Skills Assessment Test"
|
||||||
|
end
|
||||||
|
end
|
27
app/views/candidate_mailer/reminder.html.erb
Normal file
27
app/views/candidate_mailer/reminder.html.erb
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<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>Dear <strong><%= @candidate.name %></strong>,</p>
|
||||||
|
<p>
|
||||||
|
Thank you for taking the Skills Assessment Test. However, it looks like you have not submitted it
|
||||||
|
yet. If you are having troubles, please reach out to your recruiter:
|
||||||
|
<%= mail_to @candidate.recruiter.email %>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
You can return to the test here:
|
||||||
|
<%= link_to nil, root_url %>
|
||||||
|
<br>
|
||||||
|
Your test id is: <%= @candidate.test_hash %>
|
||||||
|
</p>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</table>
|
10
app/views/candidate_mailer/reminder.text.erb
Normal file
10
app/views/candidate_mailer/reminder.text.erb
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
PERFICIENT DIGITAL - Skills Assessment Test
|
||||||
|
|
||||||
|
Thank you for taking the Skills Assessment Test. However, it looks like you have not submitted it
|
||||||
|
yet. If you are having troubles, please reach out to your recruiter:
|
||||||
|
<%= @candidate.recruiter.email %>
|
||||||
|
|
||||||
|
You can return to the test here:
|
||||||
|
<%= root_url %>
|
||||||
|
|
||||||
|
Your test id is: <%= @candidate.test_hash %>
|
17
app/views/candidate_mailer/submitted.html.erb
Normal file
17
app/views/candidate_mailer/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>Dear <strong><%= @candidate.name %></strong>,</p>
|
||||||
|
<p>Thank you for taking the Skills Assessment Test. Your recruiter will be in touch.</p>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</table>
|
5
app/views/candidate_mailer/submitted.text.erb
Normal file
5
app/views/candidate_mailer/submitted.text.erb
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
PERFICIENT DIGITAL - Skills Assessment Test
|
||||||
|
|
||||||
|
Dear <%= @candidate.name %>,
|
||||||
|
|
||||||
|
Thank you for taking the Skills Assessment Test. Your recruiter will be in touch.
|
27
app/views/candidate_mailer/welcome.html.erb
Normal file
27
app/views/candidate_mailer/welcome.html.erb
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<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="text-align:center; padding:50px;">
|
||||||
|
<h1>Your Candidate ID is <i><%= @candidate.test_hash %></i></h1>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<td style="padding:15px 20px; background-color:#cdcdcd; text-align:center;">
|
||||||
|
<h4>
|
||||||
|
Please visit <%= link_to nil, root_url %>
|
||||||
|
and enter the above Candidate ID to being your test.
|
||||||
|
</h4>
|
||||||
|
<h5>We will reach back to you once we have evaluated your answers. Good luck!</h5>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</table>
|
10
app/views/candidate_mailer/welcome.text.erb
Normal file
10
app/views/candidate_mailer/welcome.text.erb
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
PERFICIENT DIGITAL - Skills Assessment Test
|
||||||
|
|
||||||
|
Your Candidate ID is <%= @candidate.test_hash %>
|
||||||
|
|
||||||
|
Please visit <%= root_url %>
|
||||||
|
and enter the above Candidate ID to being your test.
|
||||||
|
|
||||||
|
We will reach back to you once we have evaluated your answers.
|
||||||
|
|
||||||
|
Good luck!
|
@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
<style>
|
<style>
|
||||||
/* Email styles need to be inline */
|
<% # Email styles need to be inline %>
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
31
test/mailers/candidate_mailer_test.rb
Normal file
31
test/mailers/candidate_mailer_test.rb
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class CandidateMailerTest < ActionMailer::TestCase
|
||||||
|
test "welcome" do
|
||||||
|
candidate = candidates(:martha)
|
||||||
|
mail = CandidateMailer.welcome candidate
|
||||||
|
assert_match(/skills assessment test/i, mail.subject)
|
||||||
|
assert_equal [candidate.email], mail.to
|
||||||
|
assert_equal [ENV["default_mail_from"]], mail.from
|
||||||
|
assert_match candidate.test_hash, mail.body.encoded
|
||||||
|
end
|
||||||
|
|
||||||
|
test "reminder" do
|
||||||
|
candidate = candidates(:roy)
|
||||||
|
mail = CandidateMailer.reminder candidate
|
||||||
|
assert_match(/skills assessment test/i, mail.subject)
|
||||||
|
assert_equal [candidate.email], mail.to
|
||||||
|
assert_equal [ENV["default_mail_from"]], mail.from
|
||||||
|
assert_match candidate.test_hash, mail.body.encoded
|
||||||
|
assert_match candidate.recruiter.email, mail.body.encoded
|
||||||
|
end
|
||||||
|
|
||||||
|
test "submitted" do
|
||||||
|
candidate = candidates(:dawn)
|
||||||
|
mail = CandidateMailer.submitted candidate
|
||||||
|
assert_match(/skills assessment test/i, mail.subject)
|
||||||
|
assert_equal [candidate.email], mail.to
|
||||||
|
assert_equal [ENV["default_mail_from"]], mail.from
|
||||||
|
assert_match candidate.name, mail.body.encoded
|
||||||
|
end
|
||||||
|
end
|
14
test/mailers/previews/candidate_mailer_preview.rb
Normal file
14
test/mailers/previews/candidate_mailer_preview.rb
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# Preview all emails at http://localhost:3000/rails/mailers/candidate_mailer
|
||||||
|
class CandidateMailerPreview < ActionMailer::Preview
|
||||||
|
def welcome
|
||||||
|
CandidateMailer.welcome Candidate.find_by(test_hash: 'R67PmfDHGiw') # Martha
|
||||||
|
end
|
||||||
|
|
||||||
|
def reminder
|
||||||
|
CandidateMailer.reminder Candidate.find_by(test_hash: 'NmEjDkOEKY4') # Roy
|
||||||
|
end
|
||||||
|
|
||||||
|
def submitted
|
||||||
|
CandidateMailer.submitted Candidate.find_by(test_hash: 'OvP0ZqGKwJ0') # Dawn
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user