the MailMessage builders to use view(). This keeps the existing copy/labels but aligns the look with resources/views/ emails/partials/layout.blade.php. I also switched the customer add‑on receipt notification to reuse the existing branded view and added missing translations for the upload pipeline alert.
61 lines
2.0 KiB
PHP
61 lines
2.0 KiB
PHP
<?php
|
|
|
|
namespace App\Notifications\Packages;
|
|
|
|
use App\Models\TenantPackage;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Notifications\Messages\MailMessage;
|
|
use Illuminate\Notifications\Notification;
|
|
|
|
class TenantPackageEventLimitNotification extends Notification implements ShouldQueue
|
|
{
|
|
use Queueable;
|
|
|
|
public function __construct(
|
|
private readonly TenantPackage $tenantPackage,
|
|
private readonly int $limit,
|
|
) {}
|
|
|
|
public function via(object $notifiable): array
|
|
{
|
|
return ['mail'];
|
|
}
|
|
|
|
public function toMail(object $notifiable): MailMessage
|
|
{
|
|
$tenant = $this->tenantPackage->tenant;
|
|
$package = $this->tenantPackage->package;
|
|
|
|
$url = url('/tenant/billing');
|
|
$subject = __('emails.package_limits.event_limit.subject', [
|
|
'package' => $package?->getNameForLocale() ?? $package?->name ?? __('emails.package_limits.package_fallback'),
|
|
]);
|
|
$greeting = __('emails.package_limits.event_limit.greeting', [
|
|
'name' => $tenant?->name ?? __('emails.package_limits.team_fallback'),
|
|
]);
|
|
|
|
return (new MailMessage)
|
|
->subject($subject)
|
|
->view('emails.notifications.basic', [
|
|
'title' => $subject,
|
|
'preheader' => $greeting,
|
|
'heroTitle' => $greeting,
|
|
'heroSubtitle' => $subject,
|
|
'lines' => [
|
|
__('emails.package_limits.event_limit.body', [
|
|
'package' => $package?->getNameForLocale() ?? $package?->name ?? __('emails.package_limits.package_fallback'),
|
|
'limit' => $this->limit,
|
|
]),
|
|
],
|
|
'cta' => [
|
|
[
|
|
'label' => __('emails.package_limits.event_limit.action'),
|
|
'url' => $url,
|
|
],
|
|
],
|
|
'footer' => __('emails.package_limits.footer'),
|
|
]);
|
|
}
|
|
}
|