address = $address; } /** * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ public function toArray(OwnerNotifiable $notifiable): array { return [ ]; } /** * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ public function toMail(OwnerNotifiable $notifiable): MailMessage { $ip = Request::ip(); $host = Steam::getHostName($ip); $userAgent = Request::userAgent(); $time = now(config('app.timezone'))->isoFormat((string) trans('config.date_time_js')); return new MailMessage() ->markdown('emails.owner.unknown-user', ['address' => $this->address, 'ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time]) ->subject((string) trans('email.unknown_user_subject')) ; } /** * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ public function toNtfy(OwnerNotifiable $notifiable): Message { $settings = ReturnsSettings::getSettings('ntfy', 'owner', null); $message = new Message(); $message->topic($settings['ntfy_topic']); $message->title((string) trans('email.unknown_user_subject')); $message->body((string) trans('email.unknown_user_message', ['address' => $this->address])); return $message; } /** * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ public function toPushover(OwnerNotifiable $notifiable): PushoverMessage { return PushoverMessage::create((string) trans('email.unknown_user_message', ['address' => $this->address])) ->title((string) trans('email.unknown_user_subject')) ; } /** * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ public function toSlack(OwnerNotifiable $notifiable): SlackMessage { return new SlackMessage()->content( (string) trans('email.unknown_user_body', ['address' => $this->address]) ); } /** * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ public function via(OwnerNotifiable $notifiable): array { $channels = ReturnsAvailableChannels::returnChannels('owner'); $isDemoSite = FireflyConfig::get('is_demo_site'); if (true === $isDemoSite) { return array_diff($channels, ['mail']); } return $channels; } }