staff members,senderid, documents,bug fixes, etc
This commit is contained in:
47
app/Jobs/NewMnoNotesEmailAlerts.php
Normal file
47
app/Jobs/NewMnoNotesEmailAlerts.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs;
|
||||
use App\Models;
|
||||
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 NewMnoNotesEmailAlerts implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
protected $note;
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Models\Mnonote $note)
|
||||
{
|
||||
$this->note = $note;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(Mailer $mailer)
|
||||
{
|
||||
$note = $this->note;
|
||||
$emails = ['samuel@click-mobile.com'];
|
||||
|
||||
$data = [
|
||||
'client' => $note->mno_info->name,
|
||||
'created_by' => $note->created_by_info->name,
|
||||
'services' => $note->services,
|
||||
'notes_body' => $note->notes_body
|
||||
];
|
||||
$mailer->send('emails.new-mno-notes', $data, function ($message) use ($data, $emails) {
|
||||
$message->from('support@click-mobile.com', 'Click Mobile ERP');
|
||||
$message->to($emails)->subject('New Notes on Mobile Operators');
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user