領収証発行サービス
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.

61 lines
1.0KB

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