Sha256: 3d3437ade8f498dcc6a0ac8de59d6d5b6c545130f3a340ec4732f36dc6d4539d

Contents?: true

Size: 784 Bytes

Versions: 1

Compression:

Stored size: 784 Bytes

Contents

class UserMailer < ApplicationMailer
  def password_reset
    @user = params[:user]
    @signed_id = @user.password_reset_tokens.create.signed_id(expires_in: 20.minutes)

    mail to: @user.email, subject: "Reset your password"
  end

  def email_verification
    @user = params[:user]
    <%- if code_verifiable? -%>
    @user.verification_code.value = rand.to_s[2..7]
    <%- else -%>
    @signed_id = @user.email_verification_tokens.create.signed_id(expires_in: 2.days)
    <%- end -%>

    mail to: @user.email, subject: "Verify your email"
  end
  <%- if options.passwordless? %>
  def passwordless
    @user = params[:user]
    @signed_id = @user.sign_in_tokens.create.signed_id(expires_in: 1.day)

    mail to: @user.email, subject: "Your sign in link"
  end
  <%- end -%>
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
authentication-zero-2.16.5 lib/generators/authentication/templates/mailers/user_mailer.rb.tt