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    public $retryAfter = 60;
20
21    /**
22     * Create a new job instance.
23     */
24    public function __construct(
25        private readonly string $email,
26        private readonly string $companyEmail,
27        private readonly string $companyName,
28        private readonly EmailService $emailService
29    ) {
30        //
31    }
32
33    /**
34     * Execute the job.
35     */
36    public function handle(): void
37    {
38        $supportEmailList = Parameter::where('name', 'support_emails')->first();
39
40        foreach ($supportEmailList->value as $email) {
41            $this->emailService->send(
42                $email,
43                new AdminCenterReactivateUserNotification(
44                    email: $this->email,
45                    companyEmail: $this->companyEmail,
46                    companyName: $this->companyName
47                ),
48                'cac_reactivate_user'
49            );
50        }
51    }
52}