pushed the onboarding module to production
This commit is contained in:
50
app/Jobs/SendOnboardingCompletedEmailAlert.php
Normal file
50
app/Jobs/SendOnboardingCompletedEmailAlert.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?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 SendOnboardingCompletedEmailAlert implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
protected $client;
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Models\Client $client)
|
||||
{
|
||||
$this->client = $client;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(Mailer $mailer)
|
||||
{
|
||||
$client = $this->client;
|
||||
$emails = ['samuel@click-mobile.com', 'kwesi@click-mobile.com'];
|
||||
|
||||
$data = [
|
||||
'client' => $client->name,
|
||||
'created_by' => $client->auth_user_info->name,
|
||||
'country' => $client->country,
|
||||
'company_type' => $client->company_type,
|
||||
'contact_person' => $client->contact_person,
|
||||
'how_we_got' => $client->how_we_got_client
|
||||
];
|
||||
$mailer->send('emails.onboarding_completed', $data, function ($message) use ($data, $emails) {
|
||||
$message->from('support@click-mobile.com', 'Click Mobile ERP');
|
||||
$message->to($emails)->subject('Onboarding Completed');
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user