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

41 lines
817B

  1. <?php
  2. namespace App\Jobs\Email;
  3. use App\Codes\QueueName;
  4. use App\Email\Sender;
  5. use App\Models\Email;
  6. use Illuminate\Bus\Queueable;
  7. use Illuminate\Contracts\Queue\ShouldQueue;
  8. use Illuminate\Foundation\Bus\Dispatchable;
  9. use Illuminate\Queue\InteractsWithQueue;
  10. use Illuminate\Queue\SerializesModels;
  11. class SimpleEmail implements ShouldQueue
  12. {
  13. use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
  14. private string $emailId;
  15. /**
  16. * Create a new job instance.
  17. *
  18. * @return void
  19. */
  20. public function __construct(Email $email)
  21. {
  22. $this->emailId = $email->id;
  23. $this->onQueue(QueueName::EMAIL->value);
  24. }
  25. /**
  26. * Execute the job.
  27. *
  28. * @return void
  29. */
  30. public function handle()
  31. {
  32. Sender::send($this->emailId);
  33. }
  34. }