password recovery wip
This commit is contained in:
parent
cd40ef66c6
commit
49998ee5b7
12 changed files with 70 additions and 1 deletions
9
app/mailers/user_mailer.rb
Normal file
9
app/mailers/user_mailer.rb
Normal file
|
@ -0,0 +1,9 @@
|
|||
class UserMailer < ApplicationMailer
|
||||
def password_recovery
|
||||
@user = params[:user]
|
||||
recovery_code = ('a'..'z').to_a.shuffle[0,8].join
|
||||
@user.update(password_recovery_code: recovery_code)
|
||||
@url = "http://localhost:18210/password_recovery/#{@user.id}/#{recovery_code}"
|
||||
mail(to: @user.email, subject: 'Password recovery')
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue