3 namespace BookStack\App;
5 use BookStack\Translation\LocaleDefinition;
6 use BookStack\Users\Models\User;
7 use Illuminate\Bus\Queueable;
8 use Illuminate\Contracts\Queue\ShouldQueue;
9 use Illuminate\Notifications\Messages\MailMessage;
10 use Illuminate\Notifications\Notification;
12 abstract class MailNotification extends Notification implements ShouldQueue
17 * Get the mail representation of the notification.
19 abstract public function toMail(User $notifiable): MailMessage;
22 * Get the notification's channels.
24 * @param mixed $notifiable
26 * @return array|string
28 public function via($notifiable)
34 * Create a new mail message.
36 protected function newMailMessage(?LocaleDefinition $locale = null): MailMessage
38 $data = ['locale' => $locale ?? user()->getLocale()];
40 return (new MailMessage())->view([
41 'html' => 'vendor.notifications.email',
42 'text' => 'vendor.notifications.email-plain',