Class: Passwordless::Mailer

Inherits:
Object
  • Object
show all
Defined in:
app/mailers/passwordless/mailer.rb

Overview

The mailer responsible for sending Passwordless’ mails.

Instance Method Summary collapse

Instance Method Details

Sends a magic link (secret token) email.

Parameters:

  • session (Session)

    A Passwordless Session



10
11
12
13
14
15
16
17
18
19
20
# File 'app/mailers/passwordless/mailer.rb', line 10

def magic_link(session)
  @session = session

  @magic_link = send(Passwordless.mounted_as).(session.token)

  email_field = @session.authenticatable.class.passwordless_email_field
  mail(
    to: @session.authenticatable.send(email_field),
    subject: I18n.t("passwordless.mailer.subject")
  )
end