Class: Authengine::UserMailer

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

Instance Method Summary collapse

Instance Method Details

#activation(user) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'app/mailers/authengine/user_mailer.rb', line 13

def activation(user)
  setup_email(user)
  @subject    += 'Your account has been activated!'
  @url = 
  mail( :to => @recipients,
        :subject => @subject,
        :date => @sent_on,
        :from => @from
      )
end

#forgot_password(user) ⇒ Object



24
25
26
27
28
# File 'app/mailers/authengine/user_mailer.rb', line 24

def forgot_password(user)
  setup_email(user)
  @subject    += 'You have requested to change your password'
  @url  = "http://#{SITE_URL}/authengine/reset_password/#{user.password_reset_code}"
end

#message_to_admin(subject, body) ⇒ Object



35
36
37
38
39
40
41
42
43
# File 'app/mailers/authengine/user_mailer.rb', line 35

def message_to_admin(subject,body)
  @admin = User.('admin')
  @recipients  = @admin.email
  @from        = @admin.email
  @subject     = "#{APPLICATION_NAME || "database"} - "
  @sent_on     = Time.now
  @subject    += subject
  @body  = body
end

#reset_password(user) ⇒ Object



30
31
32
33
# File 'app/mailers/authengine/user_mailer.rb', line 30

def reset_password(user)
  setup_email(user)
  @subject    += 'Your password has been reset.'
end

#signup_notification(user) ⇒ Object



2
3
4
5
6
7
8
9
10
11
# File 'app/mailers/authengine/user_mailer.rb', line 2

def (user)
  setup_email(user)
  @subject    += 'Please activate your new account'  
  @url = authengine_activate_url(:activation_code => user.activation_code)
  mail( :to => @recipients,
        :subject => @subject,
        :date => @sent_on,
        :from => @from
      )
end