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

27
lib/reply_email.rb Normal file
View File

@@ -0,0 +1,27 @@
class ReplyEmail
attr_reader :reply
def initialize(reply)
@reply = reply
end
def commentable
reply.commentable
end
def recipient
reply.parent.author
end
def to
recipient.email
end
def subject
I18n.t("mailers.reply.subject")
end
def can_be_sent?
commentable.present? && recipient.present?
end
end