Class: CodeSender

Inherits:
ApplicationMailer show all
Defined in:
app/mailers/code_sender.rb

Overview

Mailer for sending codes to users

Instance Method Summary collapse

Instance Method Details

#email(code_id) ⇒ Object

Email confirmation code

Parameters:

  • code_id (Integer)


8
9
10
11
12
13
14
# File 'app/mailers/code_sender.rb', line 8

def email(code_id)
  @code = Code.find_by(id: code_id)

  return if @code.nil? || @code.user.email.blank?

  mail to: @code.user.email
end

#password(code_id) ⇒ Object

Password reset code

Parameters:

  • code_id (Integer)


19
20
21
22
23
24
25
# File 'app/mailers/code_sender.rb', line 19

def password(code_id)
  @code = Code.find_by(id: code_id)

  return if @code.nil? || @code.user.email.blank?

  mail to: @code.user.email
end