feat: add day-5 branded payment-failure reminder mailable
This commit is contained in:
35
app/Mail/PaymentFailedDay5Reminder.php
Normal file
35
app/Mail/PaymentFailedDay5Reminder.php
Normal 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'),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
27
resources/views/emails/payment-failed-day-5.blade.php
Normal file
27
resources/views/emails/payment-failed-day-5.blade.php
Normal 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>
|
||||||
Reference in New Issue
Block a user