first commit

This commit is contained in:
f4ilji
2024-09-19 16:06:49 +05:00
commit b686638a39
1664 changed files with 428174 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
<?php
namespace App\Jobs;
use App\Mail\CustomFormResponseMail;
use App\Models\CustomFormResponse;
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\Mail;
class SendFormResponseMail implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
private CustomFormResponse $customFormResponse;
/**
* Create a new job instance.
*/
public function __construct(CustomFormResponse $customFormResponse)
{
$this->customFormResponse = $customFormResponse;
}
/**
* Execute the job.
*/
public function handle(): void
{
$mail_settings = $this->customFormResponse->form->mail_settings;
foreach ($mail_settings as $setting) {
Mail::to($setting['target'])
->send(new CustomFormResponseMail($setting, $this->customFormResponse->answers, $this->customFormResponse->form->columns));
}
}
}