✨ Novo Sistema de Cancelamento com Retenção Inteligente - Wizard de 5 etapas com mensagens emocionais personalizadas - Oferta de 3 meses grátis para cancelamentos por preço (elegível se >= 3 meses pagos) - Cumprimento legal: período de garantia 7 dias com reembolso total - Rastreamento de ofertas em DB (impede reuso) - Analytics de cancelamentos (motivo, feedback, within_guarantee) 🎨 Frontend - CancellationWizard.jsx (1050+ linhas) com 5 steps - Profile.jsx com nova seção de assinatura - i18n completo em 3 idiomas (pt-BR, ES, EN) - 40+ traduções específicas 🔧 Backend - SubscriptionController: 4 novos métodos (eligibility, process, offer, execute) - PayPalService: suspensão temporária de assinatura - 2 novas tabelas: retention_offers, cancellations - Email de retenção emotivo em Blade ⚖️ Legal - 7 dias: cancelamento = reembolso total + acesso imediato termina - Após 7 dias: cancelamento = acesso até fim do período, sem reembolso - Grace period apropriado conforme período de garantia
64 lines
1.4 KiB
PHP
64 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Mail;
|
|
|
|
use App\Models\User;
|
|
use App\Models\Subscription;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Mail\Mailable;
|
|
use Illuminate\Mail\Mailables\Content;
|
|
use Illuminate\Mail\Mailables\Envelope;
|
|
use Illuminate\Queue\SerializesModels;
|
|
use Carbon\Carbon;
|
|
|
|
class CancellationRetentionOfferMail extends Mailable
|
|
{
|
|
use Queueable, SerializesModels;
|
|
|
|
public $user;
|
|
public $subscription;
|
|
public $freeMonths;
|
|
public $offerEndDate;
|
|
|
|
/**
|
|
* Create a new message instance.
|
|
*/
|
|
public function __construct(User $user, Subscription $subscription, int $freeMonths, Carbon $offerEndDate)
|
|
{
|
|
$this->user = $user;
|
|
$this->subscription = $subscription;
|
|
$this->freeMonths = $freeMonths;
|
|
$this->offerEndDate = $offerEndDate;
|
|
}
|
|
|
|
/**
|
|
* Get the message envelope.
|
|
*/
|
|
public function envelope(): Envelope
|
|
{
|
|
return new Envelope(
|
|
subject: '🎉 Oferta Especial: ' . $this->freeMonths . ' Meses Grátis!',
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Get the message content definition.
|
|
*/
|
|
public function content(): Content
|
|
{
|
|
return new Content(
|
|
view: 'emails.cancellation-retention-offer',
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Get the attachments for the message.
|
|
*
|
|
* @return array<int, \Illuminate\Mail\Mailables\Attachment>
|
|
*/
|
|
public function attachments(): array
|
|
{
|
|
return [];
|
|
}
|
|
}
|