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