Class: ForumNotificationMailer

Inherits:
DmCore::SiteMailer
  • Object
show all
Defined in:
app/mailers/forum_notification_mailer.rb

Instance Method Summary collapse

Instance Method Details

#follower_notification(user, topic, comment_list) ⇒ Object




8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/mailers/forum_notification_mailer.rb', line 8

def follower_notification(user, topic, comment_list)
           = topic.
  @subject        = "Commets: #{topic.title}"
  @recipients     = user.email
  @topic          = topic
  @comment_list   = comment_list
  @topic_link     = dm_forum.forum_forum_topic_url(topic.forum.slug, topic.slug, locale: I18n.locale)
  @forum_link     = dm_forum.forum_show_url(topic.forum.slug, locale: I18n.locale)
  
  headers = { "Return-Path" => .preferred_smtp_from_email }
  mail( from: .preferred_smtp_from_email,
        reply_to: .preferred_smtp_from_email,
        to: @recipients, subject: @subject, 
        theme: .) do |format|
    format.text { render "layouts/email_templates/forum_notification.text.erb" }
    format.html { render "layouts/email_templates/forum_notification.html.erb" }
  end
end