Class: AuthHelpers::Notifier

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
lib/auth_helpers/notifier.rb

Overview

The class responsable to send e-mails.

It uses default views in the auth_helpers/views. If you want to customize them, just do:

AuthHelpers::Notifier.template_root = "#{RAILS_ROOT}/app/views"

And put your new views at: “RAILS_ROOT/app/views/auth_helpers/notifier/”

You should also configure the sender and content_type:

AuthHelpers::Notifier.sender = %("José Valim" <[email protected]>)
AuthHelpers::Notifier.content_type = 'text/html'

Class Attribute Summary collapse

Instance Method Summary collapse

Class Attribute Details

.content_typeObject

Returns the value of attribute content_type.



17
18
19
# File 'lib/auth_helpers/notifier.rb', line 17

def content_type
  @content_type
end

.senderObject

Returns the value of attribute sender.



17
18
19
# File 'lib/auth_helpers/notifier.rb', line 17

def sender
  @sender
end

Instance Method Details

#create_confirmation(record) ⇒ Object



19
20
21
22
# File 'lib/auth_helpers/notifier.rb', line 19

def create_confirmation(record)
  @subject = I18n.t 'actionmailer.auth_helpers.create_confirmation', :default => 'Create confirmation'
  set_ivars!(record)
end

#resend_confirmation(record) ⇒ Object



34
35
36
37
# File 'lib/auth_helpers/notifier.rb', line 34

def resend_confirmation(record)
  @subject = I18n.t 'actionmailer.auth_helpers.resend_confirmation', :default => 'Confirmation code'
  set_ivars!(record)
end

#reset_password(record) ⇒ Object



29
30
31
32
# File 'lib/auth_helpers/notifier.rb', line 29

def reset_password(record)
  @subject = I18n.t 'actionmailer.auth_helpers.reset_password', :default => 'Reset password'
  set_ivars!(record)
end

#update_confirmation(record) ⇒ Object



24
25
26
27
# File 'lib/auth_helpers/notifier.rb', line 24

def update_confirmation(record)
  @subject = I18n.t 'actionmailer.auth_helpers.update_confirmation', :default => 'Update e-mail confirmation'
  set_ivars!(record)
end