From 1e92e3fe3a670e1030f721f988f39f4383addfaf Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 7 Oct 2022 11:49:00 +1100 Subject: [PATCH] Domain Failure renewal --- .../DomainRenewalFailureNotification.php | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 app/Notifications/Ninja/DomainRenewalFailureNotification.php diff --git a/app/Notifications/Ninja/DomainRenewalFailureNotification.php b/app/Notifications/Ninja/DomainRenewalFailureNotification.php new file mode 100644 index 000000000000..44eb7255e5ec --- /dev/null +++ b/app/Notifications/Ninja/DomainRenewalFailureNotification.php @@ -0,0 +1,86 @@ +domain = $domain; + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * @return array + */ + public function via($notifiable) + { + return ['slack']; + } + + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return MailMessage + */ + public function toMail($notifiable) + { + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable) + { + return [ + // + ]; + } + + public function toSlack($notifiable) + { + $content = "Domain Certificate _renewal_ failure:\n"; + $content .= "{$this->domain}\n"; + + return (new SlackMessage) + ->success() + ->from(ctrans('texts.notification_bot')) + ->image('https://app.invoiceninja.com/favicon.png') + ->content($content); + } +}