Files
coolify/app/Jobs/SubscriptionCheckoutReminderJob.php
T
Andras Bacsai 72c8209285 feat(subscription): email checkout reminders for expired sessions
Enable Stripe checkout recovery links and send rate-limited reminders to the
admin who started an unfinished subscription checkout.
2026-10-29 23:35:34 +01:00

33 lines
960 B
PHP

<?php
namespace App\Jobs;
use App\Models\User;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeEncrypted;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
class SubscriptionCheckoutReminderJob implements ShouldBeEncrypted, ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public function __construct(public User $user, public string $checkoutUrl)
{
$this->onQueue('high');
}
public function handle(): void
{
$mail = new MailMessage;
$mail->view('emails.subscription-checkout-reminder', [
'checkoutUrl' => $this->checkoutUrl,
]);
$mail->subject('Coolify: Finish subscribing to Coolify Cloud');
send_user_an_email($mail, $this->user->email);
}
}