Sha256: c418720fdade29a313f50d74cc9906124abba7ad9b3e06cfd2423ad1cf2b8377

Contents?: true

Size: 1.25 KB

Versions: 2

Compression:

Stored size: 1.25 KB

Contents

require_dependency 'barkest_core/application_mailer_base.rb'

module BarkestCore
  ##
  # This mailer is used for the account activation, password reset, and invalid password reset messages.
  #
  class UserMailer < ::BarkestCore::ApplicationMailerBase

    ##
    # Sends the activation email to a new user.
    def account_activation(data = {})
      @data = {
          user: nil,
          client_ip: '0.0.0.0'
      }.merge(data || {})
      raise unless data[:user]
      mail to: data[:user].email, subject: 'Account activation'
    end

    ##
    # Sends the password reset email to an existing user.
    def password_reset(data = {})
      @data = {
          user: nil,
          client_ip: '0.0.0.0'
      }.merge(data || {})
      raise unless data[:user]
      mail to: data[:user].email, subject: 'Password reset request'
    end

    ##
    # Sends an invalid password reset attempt message to a user whether they exist or not.
    def invalid_password_reset(data = {})
      @data = {
          email: nil,
          message: 'This email address is not associated with an existing account.',
          client_ip: '0.0.0.0'
      }.merge(data || {})
      raise unless data[:email]
      mail to: data[:email], subject: 'Password reset request'
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
barkest_core-1.5.4.0 app/mailers/barkest_core/user_mailer.rb
barkest_core-1.5.3.0 app/mailers/barkest_core/user_mailer.rb