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'),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user