Sha256: d0d981f183d09059505ac04f8ef6c016b26c26a46a334bc398ba387e8b5a43d6

Contents?: true

Size: 922 Bytes

Versions: 12

Compression:

Stored size: 922 Bytes

Contents

class TokenAuthenticateMeMailer < ActionMailer::Base
  def valid_user_reset_password_email(root_url, user)
    @root_url = root_url
    @user = user
    @token_reset_path = token_reset_path(@user)

    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 = TokenAuthenticateMe.configuration.signup_path

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

  def invite_user_email(root_url, invite)
    @root_url = root_url
    @email = invite.email
    @invite_path = invite_path(invite)

    mail(to: email, subject: 'Invitation To Join')
  end

  private

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

  def invite_path(invite)
    TokenAuthenticateMe.configuration.invite_path.sub(/:id/, invite.to_s)
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
token_authenticate_me-0.9.2 app/mailers/token_authenticate_me_mailer.rb
token_authenticate_me-0.11.2 app/mailers/token_authenticate_me_mailer.rb
token_authenticate_me-0.11.1 app/mailers/token_authenticate_me_mailer.rb
token_authenticate_me-0.11.0 app/mailers/token_authenticate_me_mailer.rb
token_authenticate_me-0.10.0 app/mailers/token_authenticate_me_mailer.rb
token_authenticate_me-0.9.1 app/mailers/token_authenticate_me_mailer.rb
token_authenticate_me-0.9.0 app/mailers/token_authenticate_me_mailer.rb
token_authenticate_me-0.8.0 app/mailers/token_authenticate_me_mailer.rb
token_authenticate_me-0.7.0 app/mailers/token_authenticate_me_mailer.rb
token_authenticate_me-0.6.0 app/mailers/token_authenticate_me_mailer.rb
token_authenticate_me-0.5.7 app/mailers/token_authenticate_me_mailer.rb
token_authenticate_me-0.5.6 app/mailers/token_authenticate_me_mailer.rb