Class: Passwordless::Mailer
- Inherits:
-
Object
- Object
- Passwordless::Mailer
- Defined in:
- app/mailers/passwordless/mailer.rb
Overview
The mailer responsible for sending Passwordless’ mails.
Instance Method Summary collapse
-
#magic_link(session) ⇒ Object
Sends a magic link (secret token) email.
Instance Method Details
#magic_link(session) ⇒ Object
Sends a magic link (secret token) email.
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).token_sign_in_url(session.token) email_field = @session.authenticatable.class.passwordless_email_field mail( to: @session.authenticatable.send(email_field), subject: I18n.t("passwordless.mailer.subject") ) end |