webmoney/backend/resources/views/emails/due-payments-alert.blade.php
marcoitaloesp-ai 6292b62315
feat: complete email system redesign with corporate templates
- Redesigned all email templates with professional corporate style
- Created base layout with dark header, status cards, and footer
- Updated: subscription-cancelled, account-activation, welcome, welcome-new-user, due-payments-alert
- Removed emojis and gradients for cleaner look
- Added multi-language support (ES, PT-BR, EN)
- Fixed email delivery (sync instead of queue)
- Fixed PayPal already-cancelled subscription handling
- Cleaned orphan subscriptions from deleted users
2025-12-18 00:44:37 +00:00

462 lines
28 KiB
PHP

@extends('emails.layouts.base')
@php $locale = $locale ?? 'pt-BR'; @endphp
@section('title')
@if($locale === 'pt-BR')
Alerta de Pagamentos
@elseif($locale === 'en')
Payment Alert
@else
Alerta de Pagos
@endif
@endsection
@section('content')
@if($locale === 'pt-BR')
{{-- Portuguese (Brazil) --}}
<p class="greeting">Olá, {{ $user->name }}</p>
<div class="content">
<p>Este é o seu resumo de pagamentos para os próximos dias.</p>
{{-- Summary Box --}}
<div class="status-card info" style="background-color: #1a1a2e; border-color: #4361ee;">
<p class="status-title" style="color: #ffffff; margin-bottom: 16px;">Resumo Financeiro</p>
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="color: #ffffff;">
<tr>
<td style="padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.1);">
<span style="color: #94a3b8;">Saldo Disponível</span>
</td>
<td style="padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.1); text-align: right; font-weight: 600;">
{{ $currency }} {{ number_format($totalBalance, 2, ',', '.') }}
</td>
</tr>
<tr>
<td style="padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.1);">
<span style="color: #94a3b8;">Total a Pagar</span>
</td>
<td style="padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.1); text-align: right; font-weight: 600; color: #f87171;">
{{ $currency }} {{ number_format($totalDue, 2, ',', '.') }}
</td>
</tr>
<tr>
<td style="padding: 8px 0;">
<span style="color: #94a3b8;">Pagamentos Pendentes</span>
</td>
<td style="padding: 8px 0; text-align: right; font-weight: 600;">
{{ $totalPayments }}
</td>
</tr>
</table>
</div>
{{-- Shortage Alert --}}
@if($shortage > 0)
<div class="status-card warning" style="background-color: #fef2f2; border-color: #dc2626;">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td width="52" valign="top">
<div style="width: 40px; height: 40px; background-color: #fecaca; border-radius: 50%; text-align: center; line-height: 40px; font-size: 18px; color: #dc2626;">!</div>
</td>
<td valign="top">
<p class="status-title" style="color: #dc2626;">Saldo Insuficiente</p>
</td>
</tr>
</table>
<p style="margin-top: 12px; color: #991b1b; text-align: center;">
<span style="font-size: 28px; font-weight: 700; display: block;">{{ $currency }} {{ number_format($shortage, 2, ',', '.') }}</span>
<span style="font-size: 13px;">em falta para cobrir todos os pagamentos</span>
</p>
</div>
@endif
{{-- Overdue Payments --}}
@if(count($overduePayments) > 0)
<div style="margin-top: 24px;">
<p style="font-size: 14px; font-weight: 600; color: #dc2626; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid #fecaca;">
Pagamentos em Atraso
</p>
@foreach($overduePayments as $payment)
<div style="background-color: #fef2f2; border-left: 4px solid #dc2626; padding: 12px 16px; margin: 8px 0; border-radius: 0 4px 4px 0;">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td>
<span style="font-weight: 600; color: #1e293b;">{{ $payment['description'] }}</span>
</td>
<td style="text-align: right;">
<span style="font-weight: 700; color: #dc2626;">{{ $currency }} {{ number_format($payment['amount'], 2, ',', '.') }}</span>
</td>
</tr>
<tr>
<td colspan="2" style="padding-top: 4px;">
<span style="font-size: 12px; color: #64748b;">Venceu em {{ \Carbon\Carbon::parse($payment['due_date'])->format('d/m/Y') }}</span>
<span style="display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 10px; font-weight: 700; text-transform: uppercase; background-color: #dc2626; color: white; margin-left: 8px;">ATRASADO</span>
</td>
</tr>
</table>
</div>
@endforeach
</div>
@endif
{{-- Tomorrow Payments --}}
@if(count($tomorrowPayments) > 0)
<div style="margin-top: 24px;">
<p style="font-size: 14px; font-weight: 600; color: #f59e0b; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid #fde68a;">
Vencem Amanhã
</p>
@foreach($tomorrowPayments as $payment)
<div style="background-color: #fffbeb; border-left: 4px solid #f59e0b; padding: 12px 16px; margin: 8px 0; border-radius: 0 4px 4px 0;">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td>
<span style="font-weight: 600; color: #1e293b;">{{ $payment['description'] }}</span>
</td>
<td style="text-align: right;">
<span style="font-weight: 700; color: #d97706;">{{ $currency }} {{ number_format($payment['amount'], 2, ',', '.') }}</span>
</td>
</tr>
<tr>
<td colspan="2" style="padding-top: 4px;">
<span style="font-size: 12px; color: #64748b;">{{ \Carbon\Carbon::parse($payment['due_date'])->format('d/m/Y') }}</span>
<span style="display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 10px; font-weight: 700; text-transform: uppercase; background-color: #f59e0b; color: white; margin-left: 8px;">AMANHÃ</span>
</td>
</tr>
</table>
</div>
@endforeach
</div>
@endif
{{-- Upcoming Payments --}}
@if(count($upcomingPayments) > 0)
<div style="margin-top: 24px;">
<p style="font-size: 14px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid #e2e8f0;">
Próximos Pagamentos
</p>
@foreach($upcomingPayments as $payment)
<div style="background-color: #f8fafc; border-left: 4px solid #64748b; padding: 12px 16px; margin: 8px 0; border-radius: 0 4px 4px 0;">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td>
<span style="font-weight: 600; color: #1e293b;">{{ $payment['description'] }}</span>
</td>
<td style="text-align: right;">
<span style="font-weight: 700; color: #475569;">{{ $currency }} {{ number_format($payment['amount'], 2, ',', '.') }}</span>
</td>
</tr>
<tr>
<td colspan="2" style="padding-top: 4px;">
<span style="font-size: 12px; color: #64748b;">{{ \Carbon\Carbon::parse($payment['due_date'])->format('d/m/Y') }}</span>
</td>
</tr>
</table>
</div>
@endforeach
</div>
@endif
<div class="divider"></div>
<div class="btn-container">
<a href="https://webmoney.cnxifly.com/dashboard" class="btn btn-primary">VER DASHBOARD</a>
</div>
</div>
@elseif($locale === 'en')
{{-- English --}}
<p class="greeting">Hello, {{ $user->name }}</p>
<div class="content">
<p>Here is your payment summary for the coming days.</p>
{{-- Summary Box --}}
<div class="status-card info" style="background-color: #1a1a2e; border-color: #4361ee;">
<p class="status-title" style="color: #ffffff; margin-bottom: 16px;">Financial Summary</p>
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="color: #ffffff;">
<tr>
<td style="padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.1);">
<span style="color: #94a3b8;">Available Balance</span>
</td>
<td style="padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.1); text-align: right; font-weight: 600;">
{{ $currency }} {{ number_format($totalBalance, 2, '.', ',') }}
</td>
</tr>
<tr>
<td style="padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.1);">
<span style="color: #94a3b8;">Total Due</span>
</td>
<td style="padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.1); text-align: right; font-weight: 600; color: #f87171;">
{{ $currency }} {{ number_format($totalDue, 2, '.', ',') }}
</td>
</tr>
<tr>
<td style="padding: 8px 0;">
<span style="color: #94a3b8;">Pending Payments</span>
</td>
<td style="padding: 8px 0; text-align: right; font-weight: 600;">
{{ $totalPayments }}
</td>
</tr>
</table>
</div>
@if($shortage > 0)
<div class="status-card warning" style="background-color: #fef2f2; border-color: #dc2626;">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td width="52" valign="top">
<div style="width: 40px; height: 40px; background-color: #fecaca; border-radius: 50%; text-align: center; line-height: 40px; font-size: 18px; color: #dc2626;">!</div>
</td>
<td valign="top">
<p class="status-title" style="color: #dc2626;">Insufficient Balance</p>
</td>
</tr>
</table>
<p style="margin-top: 12px; color: #991b1b; text-align: center;">
<span style="font-size: 28px; font-weight: 700; display: block;">{{ $currency }} {{ number_format($shortage, 2, '.', ',') }}</span>
<span style="font-size: 13px;">short to cover all payments</span>
</p>
</div>
@endif
@if(count($overduePayments) > 0)
<div style="margin-top: 24px;">
<p style="font-size: 14px; font-weight: 600; color: #dc2626; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid #fecaca;">
Overdue Payments
</p>
@foreach($overduePayments as $payment)
<div style="background-color: #fef2f2; border-left: 4px solid #dc2626; padding: 12px 16px; margin: 8px 0; border-radius: 0 4px 4px 0;">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td>
<span style="font-weight: 600; color: #1e293b;">{{ $payment['description'] }}</span>
</td>
<td style="text-align: right;">
<span style="font-weight: 700; color: #dc2626;">{{ $currency }} {{ number_format($payment['amount'], 2, '.', ',') }}</span>
</td>
</tr>
<tr>
<td colspan="2" style="padding-top: 4px;">
<span style="font-size: 12px; color: #64748b;">Due {{ \Carbon\Carbon::parse($payment['due_date'])->format('M d, Y') }}</span>
<span style="display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 10px; font-weight: 700; text-transform: uppercase; background-color: #dc2626; color: white; margin-left: 8px;">OVERDUE</span>
</td>
</tr>
</table>
</div>
@endforeach
</div>
@endif
@if(count($tomorrowPayments) > 0)
<div style="margin-top: 24px;">
<p style="font-size: 14px; font-weight: 600; color: #f59e0b; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid #fde68a;">
Due Tomorrow
</p>
@foreach($tomorrowPayments as $payment)
<div style="background-color: #fffbeb; border-left: 4px solid #f59e0b; padding: 12px 16px; margin: 8px 0; border-radius: 0 4px 4px 0;">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td>
<span style="font-weight: 600; color: #1e293b;">{{ $payment['description'] }}</span>
</td>
<td style="text-align: right;">
<span style="font-weight: 700; color: #d97706;">{{ $currency }} {{ number_format($payment['amount'], 2, '.', ',') }}</span>
</td>
</tr>
<tr>
<td colspan="2" style="padding-top: 4px;">
<span style="font-size: 12px; color: #64748b;">{{ \Carbon\Carbon::parse($payment['due_date'])->format('M d, Y') }}</span>
<span style="display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 10px; font-weight: 700; text-transform: uppercase; background-color: #f59e0b; color: white; margin-left: 8px;">TOMORROW</span>
</td>
</tr>
</table>
</div>
@endforeach
</div>
@endif
@if(count($upcomingPayments) > 0)
<div style="margin-top: 24px;">
<p style="font-size: 14px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid #e2e8f0;">
Upcoming Payments
</p>
@foreach($upcomingPayments as $payment)
<div style="background-color: #f8fafc; border-left: 4px solid #64748b; padding: 12px 16px; margin: 8px 0; border-radius: 0 4px 4px 0;">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td>
<span style="font-weight: 600; color: #1e293b;">{{ $payment['description'] }}</span>
</td>
<td style="text-align: right;">
<span style="font-weight: 700; color: #475569;">{{ $currency }} {{ number_format($payment['amount'], 2, '.', ',') }}</span>
</td>
</tr>
<tr>
<td colspan="2" style="padding-top: 4px;">
<span style="font-size: 12px; color: #64748b;">{{ \Carbon\Carbon::parse($payment['due_date'])->format('M d, Y') }}</span>
</td>
</tr>
</table>
</div>
@endforeach
</div>
@endif
<div class="divider"></div>
<div class="btn-container">
<a href="https://webmoney.cnxifly.com/dashboard" class="btn btn-primary">VIEW DASHBOARD</a>
</div>
</div>
@else
{{-- Spanish (default) --}}
<p class="greeting">Hola, {{ $user->name }}</p>
<div class="content">
<p>Este es tu resumen de pagos para los próximos días.</p>
{{-- Summary Box --}}
<div class="status-card info" style="background-color: #1a1a2e; border-color: #4361ee;">
<p class="status-title" style="color: #ffffff; margin-bottom: 16px;">Resumen Financiero</p>
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="color: #ffffff;">
<tr>
<td style="padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.1);">
<span style="color: #94a3b8;">Saldo Disponible</span>
</td>
<td style="padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.1); text-align: right; font-weight: 600;">
{{ $currency }} {{ number_format($totalBalance, 2, ',', '.') }}
</td>
</tr>
<tr>
<td style="padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.1);">
<span style="color: #94a3b8;">Total a Pagar</span>
</td>
<td style="padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.1); text-align: right; font-weight: 600; color: #f87171;">
{{ $currency }} {{ number_format($totalDue, 2, ',', '.') }}
</td>
</tr>
<tr>
<td style="padding: 8px 0;">
<span style="color: #94a3b8;">Pagos Pendientes</span>
</td>
<td style="padding: 8px 0; text-align: right; font-weight: 600;">
{{ $totalPayments }}
</td>
</tr>
</table>
</div>
@if($shortage > 0)
<div class="status-card warning" style="background-color: #fef2f2; border-color: #dc2626;">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td width="52" valign="top">
<div style="width: 40px; height: 40px; background-color: #fecaca; border-radius: 50%; text-align: center; line-height: 40px; font-size: 18px; color: #dc2626;">!</div>
</td>
<td valign="top">
<p class="status-title" style="color: #dc2626;">Saldo Insuficiente</p>
</td>
</tr>
</table>
<p style="margin-top: 12px; color: #991b1b; text-align: center;">
<span style="font-size: 28px; font-weight: 700; display: block;">{{ $currency }} {{ number_format($shortage, 2, ',', '.') }}</span>
<span style="font-size: 13px;">faltan para cubrir todos los pagos</span>
</p>
</div>
@endif
@if(count($overduePayments) > 0)
<div style="margin-top: 24px;">
<p style="font-size: 14px; font-weight: 600; color: #dc2626; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid #fecaca;">
Pagos Vencidos
</p>
@foreach($overduePayments as $payment)
<div style="background-color: #fef2f2; border-left: 4px solid #dc2626; padding: 12px 16px; margin: 8px 0; border-radius: 0 4px 4px 0;">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td>
<span style="font-weight: 600; color: #1e293b;">{{ $payment['description'] }}</span>
</td>
<td style="text-align: right;">
<span style="font-weight: 700; color: #dc2626;">{{ $currency }} {{ number_format($payment['amount'], 2, ',', '.') }}</span>
</td>
</tr>
<tr>
<td colspan="2" style="padding-top: 4px;">
<span style="font-size: 12px; color: #64748b;">Venció el {{ \Carbon\Carbon::parse($payment['due_date'])->format('d/m/Y') }}</span>
<span style="display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 10px; font-weight: 700; text-transform: uppercase; background-color: #dc2626; color: white; margin-left: 8px;">VENCIDO</span>
</td>
</tr>
</table>
</div>
@endforeach
</div>
@endif
@if(count($tomorrowPayments) > 0)
<div style="margin-top: 24px;">
<p style="font-size: 14px; font-weight: 600; color: #f59e0b; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid #fde68a;">
Vencen Mañana
</p>
@foreach($tomorrowPayments as $payment)
<div style="background-color: #fffbeb; border-left: 4px solid #f59e0b; padding: 12px 16px; margin: 8px 0; border-radius: 0 4px 4px 0;">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td>
<span style="font-weight: 600; color: #1e293b;">{{ $payment['description'] }}</span>
</td>
<td style="text-align: right;">
<span style="font-weight: 700; color: #d97706;">{{ $currency }} {{ number_format($payment['amount'], 2, ',', '.') }}</span>
</td>
</tr>
<tr>
<td colspan="2" style="padding-top: 4px;">
<span style="font-size: 12px; color: #64748b;">{{ \Carbon\Carbon::parse($payment['due_date'])->format('d/m/Y') }}</span>
<span style="display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 10px; font-weight: 700; text-transform: uppercase; background-color: #f59e0b; color: white; margin-left: 8px;">MAÑANA</span>
</td>
</tr>
</table>
</div>
@endforeach
</div>
@endif
@if(count($upcomingPayments) > 0)
<div style="margin-top: 24px;">
<p style="font-size: 14px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid #e2e8f0;">
Próximos Pagos
</p>
@foreach($upcomingPayments as $payment)
<div style="background-color: #f8fafc; border-left: 4px solid #64748b; padding: 12px 16px; margin: 8px 0; border-radius: 0 4px 4px 0;">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td>
<span style="font-weight: 600; color: #1e293b;">{{ $payment['description'] }}</span>
</td>
<td style="text-align: right;">
<span style="font-weight: 700; color: #475569;">{{ $currency }} {{ number_format($payment['amount'], 2, ',', '.') }}</span>
</td>
</tr>
<tr>
<td colspan="2" style="padding-top: 4px;">
<span style="font-size: 12px; color: #64748b;">{{ \Carbon\Carbon::parse($payment['due_date'])->format('d/m/Y') }}</span>
</td>
</tr>
</table>
</div>
@endforeach
</div>
@endif
<div class="divider"></div>
<div class="btn-container">
<a href="https://webmoney.cnxifly.com/dashboard" class="btn btn-primary">VER DASHBOARD</a>
</div>
</div>
@endif
@endsection