3 namespace BookStack\App;
5 use BookStack\Users\Models\User;
6 use Illuminate\Bus\Queueable;
7 use Illuminate\Contracts\Queue\ShouldQueue;
8 use Illuminate\Notifications\Messages\MailMessage;
9 use Illuminate\Notifications\Notification;
11 abstract class MailNotification extends Notification implements ShouldQueue
16 * Get the mail representation of the notification.
18 abstract public function toMail(User $notifiable): MailMessage;
21 * Get the notification's channels.
23 * @param mixed $notifiable
25 * @return array|string
27 public function via($notifiable)
33 * Create a new mail message.
35 protected function newMailMessage(string $language = ''): MailMessage
37 $data = ['language' => $language ?: null];
39 return (new MailMessage())->view([
40 'html' => 'vendor.notifications.email',
41 'text' => 'vendor.notifications.email-plain',