Class: Notifier

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

Instance Method Summary (collapse)

Instance Method Details

- (Object) order_confirmation(order, invoice)



31
32
33
34
35
36
37
38
39
# File 'app/models/notifier.rb', line 31

def order_confirmation(order,invoice)
  @invoice = invoice
  @order  = order
  @user   = order.user
  @url    = root_url
  @site_name = 'site_name'
  mail(:to => order.email,
       :subject => "Order Confirmation")
end

- (Object) password_reset_instructions(user)



23
24
25
26
27
28
# File 'app/models/notifier.rb', line 23

def password_reset_instructions(user)
  @user = user
  @url  = edit_customer_password_reset_url(:id => user.perishable_token)
  mail(:to => user.email,
       :subject => "Reset Password Instructions")
end

- (Object) signup_notification(recipient)

Simple Welcome mailer

> CUSTOMIZE FOR YOUR OWN APP

> user must respond to email_address_with_name and name

Parameters:

  • user (user)

    that signed up



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/models/notifier.rb', line 9

def (recipient)
  @account = recipient

  #attachments['an-image.jp'] = File.read("an-image.jpg")
  #attachments['terms.pdf'] = {:content => generate_your_pdf_here() }

  mail(:to => recipient.email_address_with_name,
       :subject => "New account information") do |format|
    format.text { render :text => "Welcome!  #{recipient.name} go to #{customer_activation_url(:a => recipient.perishable_token )}" }
    format.html { render :text => "<h1>Welcome</h1> #{recipient.name} <a href='#{customer_activation_url(:a => recipient.perishable_token )}'>Click to Activate</a>" }
  end

end