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)
account_id = repository.account_id_by_email(
email: params[:email],
) or error.invalid_account!
token = create(
account_id: account_id,
)
mailer.send_mail(
email: params[:email],
token: token,
)
nil
end
|