Sha256: 84c87e3da97ae28e480c71a9ab6928cdae04b0f73308adf166ea60d390fa5eaf

Contents?: true

Size: 555 Bytes

Versions: 9

Compression:

Stored size: 555 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
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
authentication-zero-2.16.4 lib/generators/authentication/templates/mailers/user_mailer.rb.tt
authentication-zero-2.16.3 lib/generators/authentication/templates/mailers/user_mailer.rb.tt
authentication-zero-2.16.2 lib/generators/authentication/templates/mailers/user_mailer.rb.tt
authentication-zero-2.16.1 lib/generators/authentication/templates/mailers/user_mailer.rb.tt
authentication-zero-2.16.0 lib/generators/authentication/templates/mailers/user_mailer.rb.tt
authentication-zero-2.15.9 lib/generators/authentication/templates/mailers/user_mailer.rb.tt
authentication-zero-2.15.8 lib/generators/authentication/templates/mailers/user_mailer.rb.tt
authentication-zero-2.15.7 lib/generators/authentication/templates/mailers/user_mailer.rb.tt
authentication-zero-2.15.6 lib/generators/authentication/templates/mailers/user_mailer.rb.tt