. */ declare(strict_types=1); namespace FireflyIII\Notifications\Test; use FireflyIII\Notifications\Notifiables\OwnerNotifiable; use Illuminate\Bus\Queueable; use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Notifications\Notification; /** * Class TestNotification */ class TestNotificationEmail extends Notification { use Queueable; private OwnerNotifiable $owner; /** * Create a new notification instance. */ public function __construct(OwnerNotifiable $owner) { $this->owner = $owner; } /** * Get the array representation of the notification. * * @param OwnerNotifiable $notifiable * * @SuppressWarnings(PHPMD.UnusedFormalParameter) * * @return array */ public function toArray(OwnerNotifiable $notifiable) { return [ ]; } /** * Get the mail representation of the notification. * * @param mixed $notifiable * * @SuppressWarnings(PHPMD.UnusedFormalParameter) * * @return MailMessage */ public function toMail(OwnerNotifiable $notifiable) { $address = (string) config('firefly.site_owner'); return (new MailMessage()) ->markdown('emails.admin-test', ['email' => $address]) ->subject((string) trans('email.admin_test_subject')); } /** * Get the notification's delivery channels. * * @SuppressWarnings(PHPMD.UnusedFormalParameter) * * @param mixed $notifiable * * @return array */ public function via(OwnerNotifiable $notifiable) { return ['mail']; } }