sends emails to all reviewers on new comment
This commit is contained in:
@ -23,6 +23,8 @@ module Admin
|
||||
else
|
||||
{ error: "Failed to save comment" }
|
||||
end
|
||||
|
||||
ReviewerMailer.new_comment(comment).deliver_later if comment.persisted?
|
||||
redirect_to admin_result_path(params[:test_hash]), flash: flash_message
|
||||
end
|
||||
|
||||
|
@ -19,4 +19,11 @@ class ReviewerMailer < ApplicationMailer
|
||||
|
||||
mail to: @manager.email, subject: "Voting Complete"
|
||||
end
|
||||
|
||||
def new_comment comment
|
||||
@comment = comment
|
||||
recipients = comment.candidate.reviewers.map(&:email)
|
||||
|
||||
mail to: recipients, subject: "Skills Assessment Review Comment - #{@comment.test_hash}"
|
||||
end
|
||||
end
|
||||
|
@ -23,7 +23,7 @@
|
||||
<table>
|
||||
<tr>
|
||||
<td class="email-copyright">
|
||||
©2016 All Rights Reserved - Perficient Digital
|
||||
©2016-<%= Time.now.year %> All Rights Reserved - Perficient Digital
|
||||
</td>
|
||||
<td class="email-logo">
|
||||
<%= image_tag(attachments["perficientdigital-logo.jpg"].url, alt:"Perficient Digital") %>
|
||||
|
13
app/views/reviewer_mailer/new_comment.html.inky
Normal file
13
app/views/reviewer_mailer/new_comment.html.inky
Normal file
@ -0,0 +1,13 @@
|
||||
<row>
|
||||
<columns class="email-body">
|
||||
<p>
|
||||
<%= @comment.user.name %> wrote a comment for quiz <%= @comment.test_hash %>
|
||||
</p>
|
||||
|
||||
<p style="border-top: 1px solid; border-bottom: 1px solid;">
|
||||
<%= @comment.message %>
|
||||
</p>
|
||||
|
||||
<p>You can view and reply here: <%= link_to nil, admin_result_url(@comment.test_hash) %>.</p>
|
||||
</columns>
|
||||
</row>
|
9
app/views/reviewer_mailer/new_comment.text.erb
Normal file
9
app/views/reviewer_mailer/new_comment.text.erb
Normal file
@ -0,0 +1,9 @@
|
||||
SKILLS ASSESSMENT RESULT COMMENT
|
||||
|
||||
<%= @comment.user.name %> wrote a comment for quiz <%= @comment.test_hash %>
|
||||
|
||||
--- --- --- ---
|
||||
<%= @comment.message %>
|
||||
--- --- --- ---
|
||||
|
||||
You can view and reply here: <%= admin_result_url(@comment.test_hash) %>.
|
Reference in New Issue
Block a user