34 lines
1.1 KiB
PHP
34 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Notifications;
|
|
|
|
use App\Models\Subscription;
|
|
use App\Models\User;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Notifications\Messages\MailMessage;
|
|
use Illuminate\Notifications\Notification;
|
|
|
|
class SubscriptionDowngradedNotification extends Notification
|
|
{
|
|
use Queueable;
|
|
|
|
public function __construct(public Subscription $subscription) {}
|
|
|
|
/**
|
|
* @return array<int, string>
|
|
*/
|
|
public function via(object $notifiable): array
|
|
{
|
|
return ['mail'];
|
|
}
|
|
|
|
public function toMail(User $notifiable): MailMessage
|
|
{
|
|
return (new MailMessage)
|
|
->subject(__('Your Certified subscription was switched back to Free'))
|
|
->greeting(__('Hello :name,', ['name' => $notifiable->name]))
|
|
->line(__("We didn't receive a (timely) payment, so your account has been switched back to the Free plan."))
|
|
->line(__("Your existing certificates are kept, but you won't be able to add new ones beyond the Free plan's limit."))
|
|
->action(__('Manage subscription'), route('billing.edit'));
|
|
}
|
|
}
|