Show all system emails in Admin section

This commit is contained in:
Julian Herrero
2019-02-19 22:25:11 +01:00
parent bca283c35d
commit 00bd7008bb
11 changed files with 469 additions and 27 deletions

View File

@@ -17,14 +17,11 @@ class Mailer < ApplicationMailer
end
def reply(reply)
@reply = reply
@commentable = @reply.commentable
parent = Comment.find(@reply.parent_id)
@recipient = parent.author
@email_to = @recipient.email
@email = ReplyEmail.new(reply)
@email_to = @email.to
with_user(@recipient) do
mail(to: @email_to, subject: t('mailers.reply.subject')) if @commentable.present? && @recipient.present?
with_user(@email.recipient) do
mail(to: @email_to, subject: @email.subject) if @email.can_be_sent?
end
end