module Users class RequestPasswordReset def self.call(email:) new(email: email).call end def initialize(email:) @email = email.to_s.downcase.strip end def call user = User.find_by(email: @email) return if user.nil? token = user.generate_password_reset! UserMailer.password_reset(user, token).deliver_now end end end