領収証発行サービス
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 satır
1.1KB

  1. <?php
  2. namespace App\Console\Commands;
  3. use App\Events\Mail\ConfirmEvent;
  4. use App\Logic\EmailManager;
  5. use App\Mail\Test;
  6. class TestMail extends BaseCommand
  7. {
  8. const COMMAND = "test:mail {email}";
  9. /**
  10. * The name and signature of the console command.
  11. *
  12. * @var string
  13. */
  14. protected $signature = self::COMMAND;
  15. /**
  16. * The console command description.
  17. *
  18. * @var string
  19. */
  20. protected $description = 'テストメールを送信する(キュー登録)';
  21. static public function getCommand()
  22. {
  23. return self::COMMAND;
  24. }
  25. /**
  26. * Create a new command instance.
  27. *
  28. * @return void
  29. */
  30. public function __construct()
  31. {
  32. parent::__construct();
  33. }
  34. /**
  35. * Execute the console command.
  36. *
  37. * @return int
  38. */
  39. public function service(): int
  40. {
  41. $email = $this->argument('email');
  42. $mailer = new Test();
  43. $mailer->setEmail($email);
  44. $manager = new EmailManager($mailer);
  45. $manager->confirm();
  46. return self::RESULTCODE_SUCCESS;
  47. }
  48. }