| 
									
										
										
										
											2023-08-05 21:19:23 +08:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace BookStack\Activity\Notifications\Messages; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-15 21:39:39 +08:00
										 |  |  | use BookStack\Activity\Notifications\MessageParts\ListMessageLine; | 
					
						
							| 
									
										
										
										
											2023-08-05 21:19:23 +08:00
										 |  |  | use BookStack\Entities\Models\Page; | 
					
						
							| 
									
										
										
										
											2023-09-02 22:11:42 +08:00
										 |  |  | use BookStack\Users\Models\User; | 
					
						
							| 
									
										
										
										
											2023-08-05 21:19:23 +08:00
										 |  |  | use Illuminate\Notifications\Messages\MailMessage; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class PageUpdateNotification extends BaseActivityNotification | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2023-09-02 22:11:42 +08:00
										 |  |  |     public function toMail(User $notifiable): MailMessage | 
					
						
							| 
									
										
										
										
											2023-08-05 21:19:23 +08:00
										 |  |  |     { | 
					
						
							|  |  |  |         /** @var Page $page */ | 
					
						
							|  |  |  |         $page = $this->detail; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-02 22:11:42 +08:00
										 |  |  |         $language = $notifiable->getLanguage(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         return $this->newMailMessage($language) | 
					
						
							|  |  |  |             ->subject(trans('notifications.updated_page_subject', ['pageName' => $page->getShortName()], $language)) | 
					
						
							|  |  |  |             ->line(trans('notifications.updated_page_intro', ['appName' => setting('app-name')], $language)) | 
					
						
							| 
									
										
										
										
											2023-08-15 21:39:39 +08:00
										 |  |  |             ->line(new ListMessageLine([ | 
					
						
							| 
									
										
										
										
											2023-09-02 22:11:42 +08:00
										 |  |  |                 trans('notifications.detail_page_name', [], $language) => $page->name, | 
					
						
							|  |  |  |                 trans('notifications.detail_updated_by', [], $language) => $this->user->name, | 
					
						
							| 
									
										
										
										
											2023-08-15 21:39:39 +08:00
										 |  |  |             ])) | 
					
						
							| 
									
										
										
										
											2023-09-02 22:11:42 +08:00
										 |  |  |             ->line(trans('notifications.updated_page_debounce', [], $language)) | 
					
						
							|  |  |  |             ->action(trans('notifications.action_view_page', [], $language), $page->getUrl()) | 
					
						
							|  |  |  |             ->line($this->buildReasonFooterLine($language)); | 
					
						
							| 
									
										
										
										
											2023-08-05 21:19:23 +08:00
										 |  |  |     } | 
					
						
							|  |  |  | } |