Class: Cornerstone::CornerstoneMailer

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
app/mailers/cornerstone/cornerstone_mailer.rb

Instance Method Summary collapse

Instance Method Details

#new_discussion(post, discussion) ⇒ Object

Email admins on new discussion - refer to post observer



6
7
8
9
10
# File 'app/mailers/cornerstone/cornerstone_mailer.rb', line 6

def new_discussion(post, discussion)
  @post = post
  @discussion = discussion
  mail :to => Cornerstone::Config.admin_emails
end

#new_discussion_user(post, discussion) ⇒ Object

Email user that created new discussion - refer to post observer



13
14
15
16
17
# File 'app/mailers/cornerstone/cornerstone_mailer.rb', line 13

def new_discussion_user(post, discussion)
  @post = post
  @discussion = discussion
  mail :to => post.author_email
end

#new_post(name, email, post, discussion) ⇒ Object

Email a single participant within a discussion - refer to post observer



20
21
22
23
24
25
26
27
28
# File 'app/mailers/cornerstone/cornerstone_mailer.rb', line 20

def new_post(name, email, post, discussion)
  @post = post
  @discussion = discussion
  @name = name

  mail :to => email,
       :subject => I18n.t('cornerstone.cornerstone_mailer.new_post.subject',
                          :topic => @discussion.subject)
end