php-commerce/Notifications/SubscriptionCancelled.php
Snider a774f4e285 refactor: migrate namespace from Core\Commerce to Core\Mod\Commerce
Align commerce module with the monorepo module structure by updating
all namespaces to use the Core\Mod\Commerce convention. This change
supports the recent monorepo separation and ensures consistency with
other modules.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 16:23:12 +00:00

45 lines
1.5 KiB
PHP

<?php
namespace Core\Mod\Commerce\Notifications;
use Core\Mod\Commerce\Models\Subscription;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class SubscriptionCancelled extends Notification implements ShouldQueue
{
use Queueable;
public function __construct(
public Subscription $subscription
) {}
public function via(object $notifiable): array
{
return ['mail'];
}
public function toMail(object $notifiable): MailMessage
{
return (new MailMessage)
->subject('Subscription cancelled')
->greeting('Your subscription has ended')
->line('Your subscription has been cancelled and your account has been downgraded.')
->line('You can continue using free features, but premium features are no longer available.')
->line('We\'d love to have you back. You can resubscribe at any time to restore full access.')
->action('View Plans', route('pricing'))
->line('Thank you for being a Host UK customer.')
->salutation('Host UK');
}
public function toArray(object $notifiable): array
{
return [
'subscription_id' => $this->subscription->id,
'workspace_id' => $this->subscription->workspace_id,
'cancelled_at' => $this->subscription->cancelled_at,
];
}
}