feat: add day-5 branded payment-failure reminder mailable

This commit is contained in:
Ovidiu U
2026-04-23 10:48:22 +01:00
parent de2499636f
commit c127cc379e
2 changed files with 62 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
<?php
namespace App\Mail;
use App\Models\User;
use App\Services\PlanFeatures;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
final class PaymentFailedDay5Reminder extends Mailable
{
public function __construct(public readonly User $user) {}
public function envelope(): Envelope
{
$tier = PlanFeatures::for($this->user)->tier();
return new Envelope(
subject: 'Last chance — your '.ucfirst($tier).' features end tomorrow',
);
}
public function content(): Content
{
return new Content(
markdown: 'emails.payment-failed-day-5',
with: [
'name' => $this->user->name,
'tier' => PlanFeatures::for($this->user)->tier(),
'portalUrl' => route('billing.portal'),
],
);
}
}

View File

@@ -0,0 +1,27 @@
<x-mail::message>
# Your {{ ucfirst($tier) }} features end tomorrow
Hi {{ $name }},
Stripe has been trying to renew your subscription for the past few days without
success. If the next retry doesn't go through, your **{{ ucfirst($tier) }}**
subscription will be cancelled tomorrow and your account will move back to the
Free tier.
Here's what you'll lose on Free:
- Smart fill-up / wait recommendations
- Multi-channel alerts (WhatsApp, SMS, push)
- Advanced fuel-price predictions
You can keep everything running by updating your card now:
<x-mail::button :url="$portalUrl">
Update payment method
</x-mail::button>
If you meant to cancel, no action needed you'll just drop to Free automatically.
Thanks for using FuelAlert,
The FuelAlert Team
</x-mail::message>