tabletop-companion/app/mailers/user_mailer.rb

29 lines
648 B
Ruby

# frozen_string_literal: true
class UserMailer < ApplicationMailer
helper(:mailer)
def email_verification
@user = params[:user]
@token = params[:token]
mail(to: @user.email, subject: t(".email_verification.subject"))
end
def email_verified
@user = params[:user]
mail(to: @user.email, subject: t(".email_verified.subject"))
end
def password_reset
@user = params[:user]
@token = params[:token]
return if @user.password_reset_last_sent_at&.after?(10.minutes.ago)
@user.update(password_reset_last_sent_at: Time.zone.now)
mail(to: @user.email, subject: t(".password_reset.subject"))
end
end