Sha256: c08756f1c2d9a934855152ad4c200fe718ba83815f88ece4041b2ca60a91e3a0

Contents?: true

Size: 782 Bytes

Versions: 1

Compression:

Stored size: 782 Bytes

Contents

class IdentityMailer < ApplicationMailer
  def password_reset_provision
    @<%= singular_table_name %> = params[:<%= singular_table_name %>]
    @signed_id = @<%= singular_table_name %>.signed_id(purpose: :password_reset, expires_in: 20.minutes)

    mail to: @<%= singular_table_name %>.email, subject: "Reset your password"
  end

  def email_verify_confirmation
    @<%= singular_table_name %> = params[:<%= singular_table_name %>]
    <%- if code_verifiable? -%>
    @<%= singular_table_name %>.verification_code.value = rand.to_s[2..7]
    <%- else -%>
    @signed_id = @<%= singular_table_name %>.signed_id(purpose: @<%= singular_table_name %>.email, expires_in: 2.days)
    <%- end -%>

    mail to: @<%= singular_table_name %>.email, subject: "Verify your email"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
authentication-zero-2.11.2 lib/generators/authentication/templates/mailers/identity_mailer.rb.tt