Sha256: bd282164d53dd9c5de90ec9d1dc32acaf73cf801ba9e61c0dcd0af0c1e042586

Contents?: true

Size: 644 Bytes

Versions: 7

Compression:

Stored size: 644 Bytes

Contents

class TokenAuthenticateMeMailer < ActionMailer::Base
  SIGNUP_PATH = '/sign-up'
  RESET_PATH = '/reset-password/:token/'

  def valid_user_reset_password_email(root_url, user)
    @root_url = root_url
    @user = user
    @reset_path = RESET_PATH

    @token_reset_path = token_reset_path

    mail(to: user.email, subject: 'Password Reset')
  end

  def invalid_user_reset_password_email(root_url, email)
    @root_url = root_url
    @email = email
    @signup_path = SIGNUP_PATH

    mail(to: email, subject: 'Password Reset Error')
  end

  private

  def token_reset_path
    @reset_path.sub(/:token/, @user.reset_password_token)
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
token_authenticate_me-0.4.3 app/mailers/token_authenticate_me_mailer.rb
token_authenticate_me-0.4.2 app/mailers/token_authenticate_me_mailer.rb
token_authenticate_me-0.4.1 app/mailers/token_authenticate_me_mailer.rb
token_authenticate_me-0.4.0 app/mailers/token_authenticate_me_mailer.rb
token_authenticate_me-0.3.0 app/mailers/token_authenticate_me_mailer.rb
token_authenticate_me-0.2.3 app/mailers/token_authenticate_me_mailer.rb
token_authenticate_me-0.2.2 app/mailers/token_authenticate_me_mailer.rb