Created
April 15, 2019 16:52
-
-
Save victorsteven/0fbd9e77d043880c55689dcf980c0e64 to your computer and use it in GitHub Desktop.
SendMailJob file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 Mail; | |
class SendMailJob implements ShouldQueue | |
{ | |
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; | |
/** | |
* Create a new job instance. | |
* | |
* @return void | |
*/ | |
protected $email; | |
protected $emailClass; | |
/** | |
* Create a new job instance. | |
* | |
* @return void | |
*/ | |
public function __construct($email, $emailClass) | |
{ | |
$this->email = $email; | |
$this->emailClass= $emailClass; | |
} | |
/** | |
* Execute the job. | |
* | |
* @return void | |
*/ | |
public function handle() | |
{ | |
Mail::to($this->email)->send($this->emailClass); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment