Sprankelprachtig aan/afmeldsysteem

authentication_mailer.rb 605B

1234567891011121314151617181920212223242526
  1. class AuthenticationMailer < ApplicationMailer
  2. def password_reset_email(user)
  3. token = Token.new
  4. token.user = user
  5. token.tokentype = Token::TYPES[:password_reset]
  6. token.save!
  7. @token = token
  8. @user = user
  9. mail(to: @user.email, subject: I18n.t('authentication.emails.forgot.subject'))
  10. end
  11. def password_confirm_email(user)
  12. token = Token.new
  13. token.user = user
  14. token.tokentype = Token::TYPES[:account_confirmation]
  15. token.save!
  16. @token = token
  17. @user = user
  18. mail(to: @user.email, subject: I18n.t('authentication.emails.confirm.subject'))
  19. end
  20. end