Sha256: 98b696d75bd2a9ac9ccac0d924f611fed835ea370dd188f23eb6337ec9f7ddd3

Contents?: true

Size: 908 Bytes

Versions: 6

Compression:

Stored size: 908 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.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

6 entries across 6 versions & 1 rubygems

Version Path
token_authenticate_me-0.5.5 app/mailers/token_authenticate_me_mailer.rb
token_authenticate_me-0.5.4 app/mailers/token_authenticate_me_mailer.rb
token_authenticate_me-0.5.3 app/mailers/token_authenticate_me_mailer.rb
token_authenticate_me-0.5.2 app/mailers/token_authenticate_me_mailer.rb
token_authenticate_me-0.5.1 app/mailers/token_authenticate_me_mailer.rb
token_authenticate_me-0.5.0 app/mailers/token_authenticate_me_mailer.rb