Server : LiteSpeed System : Linux server335.web-hosting.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64 User : cardxfeb ( 2452) PHP Version : 8.1.34 Disable Function : NONE Directory : /home/cardxfeb/public_html/app/Mail/ |
<?php
namespace App\Mail;
use App\Models\VCard;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;
class PaymentWarningMail extends Mailable
{
use Queueable, SerializesModels;
public string $type; // 'warning' ou 'deleted'
public string $country; // 'BR' ou 'PT'
public string $userName;
public string $cardName;
public string $payUrl;
public function __construct(public VCard $vcard, string $type = 'warning')
{
$this->type = $type;
$this->country = config('app.country', 'BR');
$this->userName = $vcard->user->name ?? 'Cliente';
$this->cardName = $vcard->name ?? 'Cartao Digital';
$this->payUrl = url('/payment/' . $vcard->id);
}
public function envelope(): Envelope
{
$subjects = [
'warning' => [
'BR' => 'Seu cartao digital sera excluido em 24 horas Regularize agora',
'PT' => 'O seu cartao digital sera eliminado em 24 horas Regularize agora',
],
'deleted' => [
'BR' => 'Seu cartao digital foi removido por falta de pagamento',
'PT' => 'O seu cartao digital foi eliminado por falta de pagamento',
],
];
return new Envelope(
subject: $subjects[$this->type][$this->country]
?? 'Aviso sobre o seu cartao digital CARD AO SEGUNDO CONTROL'
);
}
public function content(): Content
{
return new Content(view: 'emails.payment-warning');
}
}