Class: Notifier

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
app/mailer/notifier.rb

Instance Method Summary collapse

Instance Method Details

#comment_notification(subscriber, article, comment) ⇒ Object


14
15
16
17
18
19
20
21
22
23
# File 'app/mailer/notifier.rb', line 14

def comment_notification(subscriber , article , comment)
  @subscriber = subscriber
  @article = article
  @comment = comment
  @website_title = Gluttonberg::Setting.get_setting("title")
  @article_url = blog_article_url(article.blog.slug, article.slug)
  @unsubscribe_url = unsubscribe_article_comments_url(@subscriber.reference_hash)
  
  mail(:to => @subscriber.author_email, :subject => "Re: [#{@website_title}] #{@article.title}")
end

#comment_notification_for_admin(admin, article, comment) ⇒ Object


25
26
27
28
29
30
31
32
33
34
# File 'app/mailer/notifier.rb', line 25

def comment_notification_for_admin(admin , article , comment)
  @admin = admin
  @article = article
  @blog = @article.blog
  @comment = comment
  @website_title = Gluttonberg::Setting.get_setting("title")
  @article_url = blog_article_url(:blog_id => article.blog.slug, :id => article.slug)
  
  mail(:to => @admin.email, :subject => "Re: [#{@website_title}] #{@article.title}")
end

#password_reset_instructions(user_id) ⇒ Object


6
7
8
9
10
11
12
# File 'app/mailer/notifier.rb', line 6

def password_reset_instructions(user_id)
  user = User.find(user_id)
  setup_email
  @subject += "Password Reset Instructions"
  @recipients = user.email  
  @body[:edit_password_reset_url] = edit_admin_password_reset_url(user.perishable_token)
end