Changeset View
Changeset View
Standalone View
Standalone View
src/app/Jobs/SignupInvitationEmail.php
<?php | <?php | ||||
namespace App\Jobs; | namespace App\Jobs; | ||||
use App\SignupInvitation; | use App\SignupInvitation; | ||||
use App\Mail\SignupInvitation as SignupInvitationMail; | use App\Mail\SignupInvitation as SignupInvitationMail; | ||||
use Illuminate\Bus\Queueable; | use Illuminate\Bus\Queueable; | ||||
use Illuminate\Contracts\Queue\ShouldQueue; | use Illuminate\Contracts\Queue\ShouldQueue; | ||||
use Illuminate\Foundation\Bus\Dispatchable; | use Illuminate\Foundation\Bus\Dispatchable; | ||||
use Illuminate\Support\Facades\Mail; | |||||
use Illuminate\Queue\SerializesModels; | use Illuminate\Queue\SerializesModels; | ||||
use Illuminate\Queue\InteractsWithQueue; | use Illuminate\Queue\InteractsWithQueue; | ||||
class SignupInvitationEmail implements ShouldQueue | class SignupInvitationEmail implements ShouldQueue | ||||
{ | { | ||||
use Dispatchable; | use Dispatchable; | ||||
use InteractsWithQueue; | use InteractsWithQueue; | ||||
use Queueable; | use Queueable; | ||||
Show All 26 Lines | class SignupInvitationEmail implements ShouldQueue | ||||
/** | /** | ||||
* Execute the job. | * Execute the job. | ||||
* | * | ||||
* @return void | * @return void | ||||
*/ | */ | ||||
public function handle() | public function handle() | ||||
{ | { | ||||
Mail::to($this->invitation->email)->send(new SignupInvitationMail($this->invitation)); | \App\Mail\Helper::sendMail( | ||||
new SignupInvitationMail($this->invitation), | |||||
$this->invitation->tenant_id, | |||||
['to' => $this->invitation->email] | |||||
); | |||||
// Update invitation status | // Update invitation status | ||||
$this->invitation->status = SignupInvitation::STATUS_SENT; | $this->invitation->status = SignupInvitation::STATUS_SENT; | ||||
$this->invitation->save(); | $this->invitation->save(); | ||||
} | } | ||||
/** | /** | ||||
* The job failed to process. | * The job failed to process. | ||||
Show All 14 Lines |