Snapshot of main at 9f39a6e1e (2026-11-02)
This commit is contained in:
commit
6ccf1792d7
2580 files changed
+1040202
No files matched your search
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use App\Mail\AccountsEditedByAdminMail;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
|
||||
class SendAccountsEditedByAdminMail implements ShouldQueue
|
||||
{
|
||||
use Dispatchable;
|
||||
use InteractsWithQueue;
|
||||
use Queueable;
|
||||
use SerializesModels;
|
||||
|
||||
protected $profile;
|
||||
protected $changedFields;
|
||||
|
||||
public function __construct($profile, $changedFields = [])
|
||||
{
|
||||
$this->profile = $profile;
|
||||
$this->changedFields = $changedFields;
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
if (!$this->profile->email) {
|
||||
Log::warning('SendAccountsEditedByAdminMail: Profile has no email address', [
|
||||
'profile_id' => $this->profile->id,
|
||||
'profile_type' => get_class($this->profile),
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
Log::info('SendAccountsEditedByAdminMail: Sending email', [
|
||||
'profile_id' => $this->profile->id,
|
||||
'profile_type' => get_class($this->profile),
|
||||
'profile_email' => $this->profile->email,
|
||||
'changed_fields' => $this->changedFields,
|
||||
]);
|
||||
|
||||
Mail::to($this->profile->email)->send(
|
||||
new AccountsEditedByAdminMail($this->profile, $this->changedFields)
|
||||
);
|
||||
|
||||
Log::info('SendAccountsEditedByAdminMail: Email sent successfully');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user