added BillingAlertTriggeredNotification

This commit is contained in:
Čarodej
2022-03-16 10:37:55 +01:00
parent 60407f9dce
commit 9a6abbd6e8
4 changed files with 61 additions and 22 deletions
@@ -0,0 +1,42 @@
<?php
namespace Domain\Subscriptions\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
class BillingAlertTriggeredNotification extends Notification implements ShouldQueue
{
use Queueable;
public function via(): array
{
return ['mail', 'database', 'broadcast'];
}
public function toMail(): MailMessage
{
return (new MailMessage)
->subject(__('Your billing alert has been reached!'))
->greeting(__('Hi there'))
->line(__('The billing alert you set previously has been reached. Please go to your user account and revise your spending'))
->action(__('Show Billing'), url('/user/settings/billing'));
}
public function toArray(): array
{
return [
'category' => 'billing-alert',
'title' => 'billing Alert Reached!',
'description' => "The billing alert you set previously has been reached. Please revise your spending.",
'action' => [
'type' => 'route',
'params' => [
'route' => 'Billing',
'button' => 'Show Billing',
],
],
];
}
}