| 
									
										
										
										
											2016-09-18 01:22:04 +08:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace BookStack\Notifications; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-14 08:09:38 +08:00
										 |  |  | use Illuminate\Bus\Queueable; | 
					
						
							| 
									
										
										
										
											2016-09-18 01:22:04 +08:00
										 |  |  | use Illuminate\Notifications\Notification; | 
					
						
							| 
									
										
										
										
											2017-04-14 08:03:03 +08:00
										 |  |  | use Illuminate\Contracts\Queue\ShouldQueue; | 
					
						
							| 
									
										
										
										
											2016-09-18 01:22:04 +08:00
										 |  |  | use Illuminate\Notifications\Messages\MailMessage; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-14 08:03:03 +08:00
										 |  |  | class ConfirmEmail extends Notification implements ShouldQueue | 
					
						
							| 
									
										
										
										
											2016-09-18 01:22:04 +08:00
										 |  |  | { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-14 08:03:03 +08:00
										 |  |  |     use Queueable; | 
					
						
							|  |  |  |      | 
					
						
							| 
									
										
										
										
											2016-09-18 01:22:04 +08:00
										 |  |  |     public $token; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * Create a new notification instance. | 
					
						
							|  |  |  |      * @param string $token | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public function __construct($token) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         $this->token = $token; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * 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) | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2016-09-18 04:33:55 +08:00
										 |  |  |         $appName = ['appName' => setting('app-name')]; | 
					
						
							| 
									
										
										
										
											2016-09-18 01:22:04 +08:00
										 |  |  |         return (new MailMessage) | 
					
						
							| 
									
										
										
										
											2016-09-18 04:33:55 +08:00
										 |  |  |                     ->subject(trans('auth.email_confirm_subject', $appName)) | 
					
						
							|  |  |  |                     ->greeting(trans('auth.email_confirm_greeting', $appName)) | 
					
						
							|  |  |  |                     ->line(trans('auth.email_confirm_text')) | 
					
						
							|  |  |  |                     ->action(trans('auth.email_confirm_action'), baseUrl('/register/confirm/' . $this->token)); | 
					
						
							| 
									
										
										
										
											2016-09-18 01:22:04 +08:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |