bug fixes and new additions
This commit is contained in:
47
app/Jobs/SendOtpEmailAlert.php
Normal file
47
app/Jobs/SendOtpEmailAlert.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?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;
|
||||
|
||||
|
||||
class SendOtpEmailAlert implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
protected $otp_set;
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($otp_set)
|
||||
{
|
||||
$this->otp_set = $otp_set;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(Mailer $mailer)
|
||||
{
|
||||
$otp_set = $this->otp_set;
|
||||
$emails = [
|
||||
$otp_set['email']
|
||||
];
|
||||
$data = [
|
||||
'otp' => $otp_set['otp'],
|
||||
'auth_name' => $otp_set['auth_name']
|
||||
];
|
||||
$mailer->send('emails.otp', $data, function ($message) use ($data, $emails) {
|
||||
$message->from('alerts@click-mobile.com', 'Click Mobile ERP');
|
||||
$message->to($emails)->subject('Login OTP');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,8 @@ class SendTestEmail implements ShouldQueue
|
||||
$emails = [
|
||||
'kwesi@click-mobile.com',
|
||||
'kwesi_banson@hotmail.com',
|
||||
'mansa@click-mobile.com'
|
||||
'mansa@click-mobile.com',
|
||||
'diana@click-mobile.com'
|
||||
];
|
||||
$data = [];
|
||||
$mailer->send('emails.test', $data, function ($message) use ($data, $emails) {
|
||||
|
||||
Reference in New Issue
Block a user