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
-
#sign_in(session, token = nil, url_options = {}) ⇒ Object
Sends a token and a magic link.
Instance Method Details
#sign_in(session, token = nil, url_options = {}) ⇒ Object
Sends a token and a magic link
is still in memory (optional)
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/mailers/passwordless/mailer.rb', line 13 def sign_in(session, token = nil, = {}) @token = token || session.token @magic_link = Passwordless.context.url_for( session, action: "confirm", id: session.to_param, token: @token, **, ** ) email_field = session.authenticatable.class.passwordless_email_field mail( to: session.authenticatable.send(email_field), subject: I18n.t("passwordless.mailer.sign_in.subject") ) end |