Show all system emails in Admin section
This commit is contained in:
27
lib/reply_email.rb
Normal file
27
lib/reply_email.rb
Normal 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
|
||||
Reference in New Issue
Block a user