FindMemberPwVerifyinputController.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace Themes\kbgolf\pro\app\Http\Controllers\Auth;
  3. use App\Events\PasswordRemindCreated;
  4. use App\Http\Controllers\Controller;
  5. use App\Services\CallApiService;
  6. use App\Services\Msg\MailTemplateService;
  7. class FindMemberPwVerifyinputController extends Controller
  8. {
  9. private $callApiService;
  10. private $mailTemplateService;
  11. public function __construct(CallApiService $callApiService, MailTemplateService $mailTemplateService)
  12. {
  13. $this->callApiService = $callApiService;
  14. $this->mailTemplateService = $mailTemplateService;
  15. }
  16. public function emailVerifyinput()
  17. {
  18. $memberPasswdEmail = $this->callApiService->callApi([
  19. 'url' => 'member-passwd-email',
  20. 'data' => [
  21. 'Email' => request('email')
  22. ]
  23. ]);
  24. if ($this->callApiService->verifyApiError($memberPasswdEmail)) {
  25. notify()->error($memberPasswdEmail['body'], 'Error', 'bottomRight');
  26. return redirect()->back();
  27. }
  28. $this->mailTemplateService->send('msg.dabory.pro.ko_KR.email.auth.password-change-1',
  29. [
  30. 'C11' => route('password-change.index', ['code' => $memberPasswdEmail['ResetCode']])
  31. ],
  32. request('email'), sprintf('[%s] 비밀번호를 초기화하세요.', config('app.name')));
  33. return redirect()->route('member-go-email');
  34. }
  35. }