Class: RailsJwtAuth::Mailer
- Inherits:
-
ApplicationMailer
- Object
- ApplicationMailer
- RailsJwtAuth::Mailer
- Defined in:
- app/mailers/rails_jwt_auth/mailer.rb
Instance Method Summary collapse
Instance Method Details
#confirmation_instructions(user) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/mailers/rails_jwt_auth/mailer.rb', line 5 def confirmation_instructions(user) return unless user.confirmation_in_progress? @user = user if RailsJwtAuth.confirmation_url url, params = RailsJwtAuth.confirmation_url.split('?') params = params ? params.split('&') : [] params.push("confirmation_token=#{@user.confirmation_token}") @confirmation_url = "#{url}?#{params.join('&')}" else @confirmation_url = confirmation_url(confirmation_token: @user.confirmation_token) end subject = I18n.t('rails_jwt_auth.mailer.confirmation_instructions.subject') mail(to: @user.email, subject: subject) end |
#reset_password_instructions(user) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'app/mailers/rails_jwt_auth/mailer.rb', line 23 def reset_password_instructions(user) return unless user.reset_password_in_progress? @user = user if RailsJwtAuth.reset_password_url url, params = RailsJwtAuth.reset_password_url.split('?') params = params ? params.split('&') : [] params.push("reset_password_token=#{@user.reset_password_token}") @reset_password_url = "#{url}?#{params.join('&')}" else @reset_password_url = password_url(reset_password_token: @user.reset_password_token) end subject = I18n.t('rails_jwt_auth.mailer.reset_password_instructions.subject') mail(to: @user.email, subject: subject) end |