Class: Thredded::TopicEmailView

Inherits:
Object
  • Object
show all
Defined in:
app/view_models/thredded/topic_email_view.rb

Instance Method Summary collapse

Constructor Details

#initialize(topic) ⇒ TopicEmailView

Returns a new instance of TopicEmailView.

Parameters:



5
6
7
# File 'app/view_models/thredded/topic_email_view.rb', line 5

def initialize(topic)
  @topic = topic
end

Instance Method Details

#no_replyObject



21
22
23
# File 'app/view_models/thredded/topic_email_view.rb', line 21

def no_reply
  Thredded.email_from
end

#reply_toObject



17
18
19
# File 'app/view_models/thredded/topic_email_view.rb', line 17

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

#smtp_api_tag(tag) ⇒ Object



9
10
11
# File 'app/view_models/thredded/topic_email_view.rb', line 9

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

#subjectObject



13
14
15
# File 'app/view_models/thredded/topic_email_view.rb', line 13

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