Class: Monban::UseCase::Auth::Token::Reset

Inherits:
Base
  • Object
show all
Includes:
Helper
Defined in:
lib/monban/use_case/auth/token/reset.rb

Instance Method Summary collapse

Instance Method Details

#send_mail(params) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/monban/use_case/auth/token/reset.rb', line 37

def send_mail(params)
  Getto::Params.new.validate(params) do |v|
    v.hash(
      email: v.combine([v.string, v.match(%r{@})]){|val| param_error!(email: val) },
    )
  end or param_error!(params: params)

   = repository.(
    email: params[:email],
  ) or error.invalid_account!

  token = create(
    account_id: ,
  )

  mailer.send_mail(
    email: params[:email],
    token: token,
  )

  nil
end