multiple bug fixes including sender ID filtering
This commit is contained in:
48
app/Jobs/SendHolidayEmailAlerts.php
Normal file
48
app/Jobs/SendHolidayEmailAlerts.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Contracts\Mail\Mailer;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class SendHolidayEmailAlerts implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
protected $holiday_arr;
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($holiday_arr)
|
||||
{
|
||||
$this->holiday_arr = $holiday_arr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(Mailer $mailer)
|
||||
{
|
||||
Log::info("Holidays in mailer job started.");
|
||||
$holiday_arr = $this->holiday_arr;
|
||||
$emails = [
|
||||
'clicmobile@click-mobile.com',
|
||||
];
|
||||
$data = [
|
||||
'holiday_arr' => $holiday_arr
|
||||
];
|
||||
$mailer->send('emails.holidays', $data, function ($message) use ($data, $emails) {
|
||||
$message->from('alerts@click-mobile.com', 'Click Mobile ERP Team');
|
||||
$message->to($emails)->subject('Upcoming Holidays');
|
||||
});
|
||||
Log::info("Holiday emails dispatched successfully.");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user