Class: NotificationMailer

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

Instance Method Summary collapse

Instance Method Details

#article(article, user) ⇒ Object



7
8
9
10
11
12
# File 'app/mailers/notification_mailer.rb', line 7

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

#comment(comment, user) ⇒ Object



14
15
16
17
18
19
# File 'app/mailers/notification_mailer.rb', line 14

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



21
22
23
24
25
26
# File 'app/mailers/notification_mailer.rb', line 21

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