Class: NotificationMailer

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

Instance Method Summary collapse

Instance Method Details

#article(article, user) ⇒ Object



5
6
7
8
9
10
# File 'app/mailers/notification_mailer.rb', line 5

def article(article, user)
  @user = user
  @blog = article.blog
  @article = article
  build_mail @blog, @user, "New article: #{article.title}"
end

#comment(comment, user) ⇒ Object



12
13
14
15
16
17
# File 'app/mailers/notification_mailer.rb', line 12

def comment(comment, user)
  @user = user
  @blog = comment.blog
  @comment = comment
  build_mail @blog, @user, "New comment on #{comment.article.title}"
end

#notif_user(user) ⇒ Object



19
20
21
22
23
24
# File 'app/mailers/notification_mailer.rb', line 19

def notif_user(user)
  @user = user
  # TODO: Make user blog-dependent
  @blog = Blog.first
  build_mail @blog, @user, 'Welcome to Publify'
end