Created
July 2, 2018 09:25
-
-
Save studio-fars-company/424cbd65183d23aaa6b12ace7cdc873e 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\Notifications; | |
use Illuminate\Bus\Queueable; | |
use Illuminate\Notifications\Notification; | |
use Illuminate\Contracts\Queue\ShouldQueue; | |
use Illuminate\Notifications\Messages\MailMessage; | |
class RegisterNotify extends Notification | |
{ | |
use Queueable; | |
/** 認証コード*/ | |
private $code; | |
/** | |
* Create a new notification instance. | |
* | |
* @return void | |
*/ | |
public function __construct($code) | |
{ | |
$this->code = $code; | |
} | |
/** | |
* Get the notification's delivery channels. | |
* | |
* @param mixed $notifiable | |
* @return array | |
*/ | |
public function via($notifiable) | |
{ | |
return ['mail']; | |
} | |
/** | |
* Get the mail representation of the notification. | |
* | |
* @param mixed $notifiable | |
* @return \Illuminate\Notifications\Messages\MailMessage | |
*/ | |
public function toMail($notifiable) | |
{ | |
return (new MailMessage) | |
->subject(trans('sentinel.register_user_title')) | |
->greeting($notifiable->name.trans('sentinel.register_user_name')) | |
->line(config('app.name').trans('sentinel.register_user_intro')) | |
->action(trans('sentinel.register_user_button'), | |
url('activate', [base64_encode($notifiable->email), $this->code])) | |
->line(trans('sentinel.register_user_outro')); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment