feat: Complete checkout overhaul with Stripe PaymentIntent integration and abandoned cart recovery
This commit is contained in:
53
app/Mail/AbandonedCheckout.php
Normal file
53
app/Mail/AbandonedCheckout.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use App\Models\Package;
|
||||
use App\Models\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Mail\Mailables\Content;
|
||||
use Illuminate\Mail\Mailables\Envelope;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class AbandonedCheckout extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
public function __construct(
|
||||
public User $user,
|
||||
public Package $package,
|
||||
public string $timing, // '1h', '24h', '1w'
|
||||
public string $resumeUrl
|
||||
) {
|
||||
//
|
||||
}
|
||||
|
||||
public function envelope(): Envelope
|
||||
{
|
||||
$subjectKey = 'emails.abandoned_checkout.subject_' . $this->timing;
|
||||
return new Envelope(
|
||||
subject: __('emails.abandoned_checkout.subject_' . $this->timing, [
|
||||
'package' => $this->package->name
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
public function content(): Content
|
||||
{
|
||||
return new Content(
|
||||
view: 'emails.abandoned-checkout',
|
||||
with: [
|
||||
'user' => $this->user,
|
||||
'package' => $this->package,
|
||||
'timing' => $this->timing,
|
||||
'resumeUrl' => $this->resumeUrl,
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
public function attachments(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user