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.
|
- <?php
-
- namespace App\Console\Commands;
-
- use App\Logic\EmailManager;
- use App\Mail\Test;
-
- class TestMail extends BaseCommand
- {
-
- const COMMAND = "mail:test {email}";
-
- /**
- * The name and signature of the console command.
- *
- * @var string
- */
- protected $signature = self::COMMAND;
-
- /**
- * The console command description.
- *
- * @var string
- */
- protected $description = 'テストメールを送信する(キュー登録)';
-
- static public function getCommand()
- {
- return self::COMMAND;
- }
-
-
- /**
- * Create a new command instance.
- *
- * @return void
- */
- public function __construct()
- {
- parent::__construct();
- }
-
- /**
- * Execute the console command.
- *
- * @return int
- */
- public function service(): int
- {
- $email = $this->argument('email');
-
- $mailer = new Test();
- $mailer->setEmail($email);
-
- $manager = new EmailManager($mailer);
- $manager->confirm();
-
- return self::RESULTCODE_SUCCESS;
- }
- }
|