Last active
June 4, 2019 13:54
-
-
Save BenmrChen/b85e75b4b1c11b1a1c9b5b3920084eb4 to your computer and use it in GitHub Desktop.
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 SendSignUpMailJob implements ShouldQueue | |
{ | |
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; | |
/** | |
* Create a new job instance. | |
* | |
* @return void | |
*/ | |
protected $mail_binding; | |
public function __construct($mail_binding) | |
{ | |
$this->mail_binding = $mail_binding; | |
} | |
/** | |
* Execute the job. | |
* | |
* @return void | |
*/ | |
// 執行工作 | |
public function handle() | |
{ | |
$mail_binding = $this->mail_binding; | |
Mail::send( | |
'email.signUpEmailNotification', | |
$mail_binding, | |
function($mail) use ($mail_binding) | |
{ | |
$mail->to($mail_binding['email']); | |
$mail->from('Test123@gmail.com'); | |
$mail->subject('恭喜您,已成功註冊'); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment