Class: OTP::Mailer

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
lib/otp/mailer.rb

Overview

OTP mailer.

Instance Method Summary collapse

Instance Method Details

#otp(email, otp_code, model, mail_opts = {}) ⇒ Mail

Sends an email containing the OTP

Parameters:

  • email (String)

    the email address to send to

  • otp_code (String)

    the OTP code to include

  • model (ActiveRecord::Base)

    model to expose

  • mail_opts (Hash) (defaults to: {})

    arbitrary options to pass to ‘mail()` method

Returns:

  • (Mail)

    instance



18
19
20
21
22
23
# File 'lib/otp/mailer.rb', line 18

def otp(email, otp_code, model, mail_opts = {})
  @model = model
  @otp_code = otp_code

  mail(to: email, **mail_opts)
end