Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 12
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
ReactivateUserNotification
0.00% covered (danger)
0.00%
0 / 12
0.00% covered (danger)
0.00%
0 / 2
12
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 handle
0.00% covered (danger)
0.00%
0 / 11
0.00% covered (danger)
0.00%
0 / 1
6
1<?php
2
3namespace App\Jobs\Emails;
4
5use App\Http\Models\Parameter;
6use App\Mail\AdminCenterReactivateUserNotification;
7use App\Services\Email\EmailService;
8use Illuminate\Bus\Queueable;
9use Illuminate\Contracts\Queue\ShouldQueue;
10use Illuminate\Foundation\Bus\Dispatchable;
11use Illuminate\Queue\InteractsWithQueue;
12use Illuminate\Queue\SerializesModels;
13
14class ReactivateUserNotification implements ShouldQueue
15{
16    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
17
18    public $tries = 3;
19
20    public $retryAfter = 60;
21
22    /**
23     * Create a new job instance.
24     */
25    public function __construct(
26        private readonly string $email,
27        private readonly string $companyEmail,
28        private readonly string $companyName,
29        private readonly EmailService $emailService
30    ) {
31        //
32    }
33
34    /**
35     * Execute the job.
36     */
37    public function handle(): void
38    {
39        $supportEmailList = Parameter::where('name', 'support_emails')->first();
40
41        foreach ($supportEmailList->value as $email) {
42            $this->emailService->send(
43                $email,
44                new AdminCenterReactivateUserNotification(
45                    email: $this->email,
46                    companyEmail: $this->companyEmail,
47                    companyName: $this->companyName
48                ),
49                'cac_reactivate_user'
50            );
51        }
52    }
53}