Class: People::AccountMailer

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
app/mailers/people/account_mailer.rb

Instance Method Summary collapse

Instance Method Details

#email_confirmation(user) ⇒ Object

Need to send an email saying confirm email address



13
14
15
16
17
18
19
20
# File 'app/mailers/people/account_mailer.rb', line 13

def email_confirmation(user)
	#Need to send an email with a link to account_controller#email_confirm
	@user = user
	@email_hash = @user.email_hashes.new
	@email_hash.email_type = ::People::EmailHash.email_confirm
	@email_hash.save
  mail(to: @user.email, subject: 'Confirm your email')
end

#forgot_password(user) ⇒ Object

Need to send an email saying click to change password



38
39
40
41
42
43
44
45
# File 'app/mailers/people/account_mailer.rb', line 38

def forgot_password(user)
	#Need to send an email with a link to account_controller#new_password
	@user = user
	@email_hash = @user.email_hashes.new
	@email_hash.email_type = ::People::EmailHash.forgotten_password
	@email_hash.save
  mail(to: @user.email, subject: 'Reset your password')
end

#password_reset(user) ⇒ Object



47
48
49
50
# File 'app/mailers/people/account_mailer.rb', line 47

def password_reset(user)
  @user = user
  mail(to: @user.email, subject: 'Password reset')
end

#unlock_account(user) ⇒ Object

Need to send an email saying your account is locked



28
29
30
31
32
33
34
35
# File 'app/mailers/people/account_mailer.rb', line 28

def (user)
	#Need to send an email with a link to account_controller#new_password
	@user = user
	@email_hash = @user.email_hashes.new
	@email_hash.email_type = ::People::EmailHash.forgotten_password
	@email_hash.save
  mail(to: @user.email, subject: 'Account locked')
end

#welcome_email(user) ⇒ Object

Need to send an email saying welcome



7
8
9
10
# File 'app/mailers/people/account_mailer.rb', line 7

def welcome_email(user)
	@user = user
  mail(to: @user.email, subject: 'Welcome!')
end

#you_confirmed_email(user) ⇒ Object



22
23
24
25
# File 'app/mailers/people/account_mailer.rb', line 22

def you_confirmed_email(user)
  @user = user
  mail(to: @user.email, subject: 'Email confirmed')
end