Class: Thredded::TopicEmailDecorator

Inherits:
Object
  • Object
show all
Defined in:
app/decorators/thredded/topic_email_decorator.rb

Instance Method Summary collapse

Constructor Details

#initialize(topic) ⇒ TopicEmailDecorator

Returns a new instance of TopicEmailDecorator.

Parameters:



4
5
6
# File 'app/decorators/thredded/topic_email_decorator.rb', line 4

def initialize(topic)
  @topic = topic
end

Instance Method Details

#no_reply ⇒ Object



20
21
22
# File 'app/decorators/thredded/topic_email_decorator.rb', line 20

def no_reply
  Thredded.email_from
end

#reply_to ⇒ Object



16
17
18
# File 'app/decorators/thredded/topic_email_decorator.rb', line 16

def reply_to
  Thredded.email_reply_to.call(@topic)
end

#smtp_api_tag(tag) ⇒ Object



8
9
10
# File 'app/decorators/thredded/topic_email_decorator.rb', line 8

def smtp_api_tag(tag)
  %({"category": ["thredded_#{@topic.private? ? 'private_topic' : @topic.messageboard.name}","#{tag}"]})
end

#subject ⇒ Object



12
13
14
# File 'app/decorators/thredded/topic_email_decorator.rb', line 12

def subject
  "#{Thredded.email_outgoing_prefix} #{@topic.title}"
end