Переглянути джерело

Merge branch 'feature/DIARIA-kay-implementação-envio-de-emails' of Softpar/sfp_api_laravel_diarista into development

zntt 1 місяць тому
батько
коміт
c2b67ee78f

+ 28 - 11
app/Jobs/FinishScheduleJob.php

@@ -11,6 +11,7 @@ use Illuminate\Contracts\Queue\ShouldQueue;
 use Illuminate\Foundation\Bus\Dispatchable;
 use Illuminate\Queue\InteractsWithQueue;
 use Illuminate\Queue\SerializesModels;
+use App\Services\EmailService;
 use Illuminate\Support\Facades\Log;
 
 class FinishScheduleJob implements ShouldQueue
@@ -26,22 +27,22 @@ class FinishScheduleJob implements ShouldQueue
     try {
       $schedule = Schedule::find($this->scheduleId);
       $date_cleaned = Carbon::parse($schedule->date)->format('Y-m-d');
-  
+
       if (!$schedule) {
         return;
       }
-  
+
       Log::channel('schedule_end_jobs')->info('Verificando status do agendamento id: ' . $schedule->id);
       Log::channel('schedule_end_jobs')->info('Status do agendamento: ' . $schedule->status);
-  
+
       if ($schedule->status !== 'started') {
         return;
       }
-  
+
       Log::channel('schedule_end_jobs')->info('Verificando data');
       Log::channel('schedule_end_jobs')->info('Data do agendamento: ' . $date_cleaned);
       Log::channel('schedule_end_jobs')->info('Data atual: ' . now()->toDateString());
-      
+
 
       if ($date_cleaned > now()->toDateString()) {
         return;
@@ -50,15 +51,15 @@ class FinishScheduleJob implements ShouldQueue
       Log::channel('schedule_end_jobs')->info('Verificando horário');
       Log::channel('schedule_end_jobs')->info('Horário do agendamento: ' . $schedule->end_time);
       Log::channel('schedule_end_jobs')->info('Horário atual: ' . now()->toTimeString());
-  
+
       $end_date_time = Carbon::parse($date_cleaned . ' ' . $schedule->end_time);
-      
+
       if ($end_date_time > now()) {
         return;
       }
-  
+
       Log::channel('schedule_end_jobs')->info('Validado com sucesso, atualizado agendamento id: ' . $schedule->id . ' para status finalizado');
-  
+
       $schedule->update([
         'status' => 'finished'
       ]);
@@ -67,12 +68,28 @@ class FinishScheduleJob implements ShouldQueue
       $provider->update([
         'total_services' => $provider->total_services + 1,
       ]);
-      
+
       $client = Client::find($schedule->client_id);
       $client->update([
         'total_services' => $client->total_services + 1,
       ]);
-
+      $emailService = new EmailService();
+      $serviceAmount = (float) $schedule->total_amount;
+      $serviceFee = 7.00;
+      $finalAmount = $serviceAmount + $serviceFee;
+      $emailService->sendEmailReceipt(
+        email: $schedule->client->user->email,
+        schedule: $schedule,
+        client_name: $schedule->client->user->name,
+        service_date: $schedule->date,
+        start_time: $schedule->start_time,
+        end_time: $schedule->end_time,
+        address: $schedule->address->address,
+        total_amount: $serviceAmount,
+        service_fee: $serviceFee,
+        final_amount: $finalAmount,
+        payment_method: 'PIX'
+      );
     } catch (\Exception $e) {
       Log::channel('schedule_end_jobs')->error('Erro ao finalizar agendamento id: ' . $this->scheduleId . '. Erro: ' . $e->getMessage());
       return;

+ 61 - 0
app/Mail/EmailReceipt.php

@@ -0,0 +1,61 @@
+<?php
+
+namespace App\Mail;
+
+use Illuminate\Bus\Queueable;
+use Illuminate\Mail\Mailable;
+use Illuminate\Mail\Mailables\Content;
+use Illuminate\Mail\Mailables\Envelope;
+use Illuminate\Queue\SerializesModels;
+
+class EmailReceipt extends Mailable
+{
+    use Queueable, SerializesModels;
+
+    public function __construct(
+
+        public readonly object $schedule,
+
+        public readonly string $client_name,
+
+        public readonly string $service_date,
+
+        public readonly string $start_time,
+
+        public readonly string $end_time,
+
+        public readonly string $address,
+
+        public readonly string $total_amount,
+
+        public readonly string $service_fee,
+
+        public readonly string $final_amount,
+
+        public readonly string $payment_method,
+
+    ) {}
+
+    public function envelope(): Envelope
+    {
+        return new Envelope(
+
+            subject: __('mail.service_completed.subject'),
+
+        );
+    }
+
+    public function content(): Content
+    {
+        return new Content(
+
+            view: 'emails.email_receipt',
+
+        );
+    }
+
+    public function attachments(): array
+    {
+        return [];
+    }
+}

+ 17 - 0
app/Services/EmailService.php

@@ -4,6 +4,7 @@ namespace App\Services;
 
 use App\Mail\SendCodeMail;
 use Illuminate\Support\Facades\Mail;
+use App\Mail\EmailReceipt;
 
 class EmailService
 {
@@ -18,4 +19,20 @@ class EmailService
     {
         Mail::to($email)->send(new SendCodeMail($code, $recipientName));
     }
+
+    public function sendEmailReceipt(
+        string $email, 
+        object $schedule, 
+        string $client_name, 
+        string $service_date, 
+        string $start_time, 
+        string $end_time, 
+        string $address, 
+        string $total_amount, 
+        string $service_fee, 
+        string $final_amount,
+        string $payment_method): void
+    {
+        Mail::to($email)->send(new EmailReceipt($schedule, $client_name, $service_date, $start_time, $end_time, $address, $total_amount, $service_fee, $final_amount, $payment_method));
+    }
 }

+ 27 - 1
lang/en/mail.php

@@ -5,10 +5,36 @@ return [
         'subject'           => 'Your verification code',
         'header_subtitle'   => 'Access verification',
         'greeting'          => 'Hello, :name!',
-        'greeting_anonymous'=> 'Hello!',
+        'greeting_anonymous' => 'Hello!',
         'body_intro'        => 'Use the code below to access your account',
         'expiry_notice'     => 'This code expires in 15 minutes.',
         'ignore_notice'     => 'If you did not request this code, please ignore this email.',
         'footer_note'       => 'This is an automated email. Please do not reply.',
+        'footer_title' => 'Thank you for using the Diaria App ',
+    ],
+    'service_completed' => [
+        'subject' => 'Service completed successfully',
+        'title' => 'Service Completed',
+        'subtitle' => 'Your payment has been successfully confirmed.',
+        'payment_confirmed' => 'Payment confirmed',
+        'payment_confirmed_subtitle' => 'The service has been completed and payment approved.',
+        'service_resume' => 'Service summary',
+        'client' => 'Client',
+        'service_date' => 'Service date',
+        'service_time' => 'Time',
+        'service_address' => 'Address',
+        'payment_title' => 'Payment',
+        'total_amount' => 'Total amount',
+        'payment_method' => 'Payment method',
+        'paid' => 'Paid',
+        'payment_success' => 'Payment processed and confirmed successfully.',
+        'footer_title' => 'Thank you for using Diaria App 💜',
+        'footer_description' => 'We hope your experience was amazing. Count on us for your next services.',
+        'footer_help' => 'Need help?',
+        'footer_contact' => 'Contact our support',
+        'footer_note' => 'This is an automatic email. Please do not reply.',
+        'service_fee' => 'Service fee',
+        'final_amount' => 'Final amount',
+        'currency' => '$',
     ],
 ];

+ 27 - 1
lang/es/mail.php

@@ -5,10 +5,36 @@ return [
         'subject'           => 'Tu código de verificación',
         'header_subtitle'   => 'Verificación de acceso',
         'greeting'          => '¡Hola, :name!',
-        'greeting_anonymous'=> '¡Hola!',
+        'greeting_anonymous' => '¡Hola!',
         'body_intro'        => 'Usa el código a continuación para acceder a tu cuenta',
         'expiry_notice'     => 'Este código expira en 15 minutos.',
         'ignore_notice'     => 'Si no solicitaste este código, ignora este correo.',
         'footer_note'       => 'Este es un correo automático. Por favor, no respondas.',
+        'footer_title' => 'Gracias por usar la aplicación Diaria ',
+    ],
+    'service_completed' => [
+        'subject' => 'Servicio finalizado con éxito',
+        'title' => 'Servicio Finalizado',
+        'subtitle' => 'Su pago fue confirmado con éxito.',
+        'payment_confirmed' => 'Pago confirmado',
+        'payment_confirmed_subtitle' => 'El servicio fue completado y el pago aprobado.',
+        'service_resume' => 'Resumen del servicio',
+        'client' => 'Cliente',
+        'service_date' => 'Fecha del servicio',
+        'service_time' => 'Horario',
+        'service_address' => 'Dirección',
+        'payment_title' => 'Pago',
+        'total_amount' => 'Valor total',
+        'payment_method' => 'Método de pago',
+        'paid' => 'Pagado',
+        'payment_success' => 'Pago procesado y confirmado exitosamente.',
+        'footer_title' => 'Gracias por usar Diaria App 💜',
+        'footer_description' => 'Esperamos que su experiencia haya sido increíble. Cuente con nosotros para sus próximos servicios.',
+        'footer_help' => '¿Necesita ayuda?',
+        'footer_contact' => 'Contacte nuestro soporte',
+        'footer_note' => 'Este es un correo automático. Por favor no responda.',
+        'service_fee' => 'Tarifa del servicio',
+        'final_amount' => 'Valor final',
+        'currency' => 'US$',
     ],
 ];

+ 27 - 1
lang/pt/mail.php

@@ -5,10 +5,36 @@ return [
         'subject'           => 'Seu código de verificação',
         'header_subtitle'   => 'Verificação de acesso',
         'greeting'          => 'Olá, :name!',
-        'greeting_anonymous'=> 'Olá!',
+        'greeting_anonymous' => 'Olá!',
         'body_intro'        => 'Use o código abaixo para acessar sua conta',
         'expiry_notice'     => 'Este código expira em 15 minutos.',
         'ignore_notice'     => 'Se você não solicitou este código, ignore este e-mail.',
         'footer_note'       => 'Este é um e-mail automático. Por favor, não responda.',
+        'footer_title'      => 'Obrigado por utilizar o Diaria App ',
+    ],
+    'service_completed' => [
+        'subject' => 'Serviço finalizado com sucesso',
+        'title' => 'Serviço Finalizado',
+        'subtitle' => 'Seu pagamento foi confirmado com sucesso.',
+        'payment_confirmed' => 'Pagamento confirmado',
+        'payment_confirmed_subtitle' => 'O serviço foi concluído e o pagamento aprovado.',
+        'service_resume' => 'Resumo do serviço',
+        'client' => 'Cliente',
+        'service_date' => 'Data do serviço',
+        'service_time' => 'Horário',
+        'service_address' => 'Endereço',
+        'payment_title' => 'Pagamento',
+        'total_amount' => 'Valor total',
+        'payment_method' => 'Forma de pagamento',
+        'paid' => 'Pago',
+        'payment_success' => 'Pagamento processado e confirmado com sucesso.',
+        'footer_title' => 'Obrigado por utilizar o Diaria App 💜',
+        'footer_description' => 'Esperamos que sua experiência tenha sido incrível. Conte sempre com a gente para seus próximos serviços.',
+        'footer_help' => 'Precisa de ajuda?',
+        'footer_contact' => 'Fale com nosso suporte',
+        'footer_note' => 'Este é um e-mail automático. Não responda esta mensagem.',
+        'service_fee' => 'Taxa de serviço',
+        'final_amount' => 'Valor final',
+        'currency' => 'R$',
     ],
 ];

Різницю між файлами не показано, бо вона завелика
+ 2 - 0
public/images/diarinho_email_code.svg


Різницю між файлами не показано, бо вона завелика
+ 2 - 0
public/images/diarinho_email_welcome.svg


Різницю між файлами не показано, бо вона завелика
+ 6 - 0
public/images/diarinho_perfil_cliente_favoritos.svg


+ 0 - 0
storage/app/public/.gitignore → public/storage/.gitignore


+ 639 - 0
resources/views/emails/email_receipt.blade.php

@@ -0,0 +1,639 @@
+<!DOCTYPE html>
+<html lang="pt-BR">
+
+<head>
+
+  <meta charset="UTF-8" />
+
+  <meta
+    name="viewport"
+    content="width=device-width, initial-scale=1.0"
+  />
+
+  <title>
+    {{ __('mail.service_completed.subject') }}
+  </title>
+
+  <!-- CSS -->
+
+  <style>
+
+    * {
+      margin: 0;
+      padding: 0;
+      box-sizing: border-box;
+      font-family: Arial, Helvetica, sans-serif;
+    }
+
+    body {
+      background: #f5f5f7;
+      padding: 20px;
+    }
+
+    .email-container {
+      max-width: 650px;
+      margin: 0 auto;
+      background: #ffffff;
+      border-radius: 24px;
+      overflow: hidden;
+      box-shadow: 0 10px 40px rgba(0,0,0,0.08);
+    }
+
+    /* HEADER */
+
+    .header {
+      background: linear-gradient(135deg, #7b2cff, #4d14d1);
+      padding: 50px 30px 30px;
+      color: white;
+    }
+
+    .header-content {
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      gap: 20px;
+    }
+
+    .header-text {
+      flex: 1;
+    }
+
+    .title {
+      font-size: 52px;
+      font-weight: 800;
+      line-height: 1;
+      margin-bottom: 20px;
+    }
+
+    .subtitle {
+      font-size: 20px;
+      line-height: 1.5;
+      opacity: 0.95;
+    }
+
+    .diarinho {
+      width: 220px;
+    }
+
+    /* CONTENT */
+
+    .content {
+      padding: 30px;
+      background: #f5f5f7;
+    }
+
+    /* STATUS */
+
+    .success-card {
+      background: white;
+      border-radius: 22px;
+      padding: 22px;
+      display: flex;
+      align-items: center;
+      gap: 18px;
+      margin-bottom: 24px;
+    }
+
+    .success-icon {
+      width: 60px;
+      height: 60px;
+      border-radius: 999px;
+      background: #4cd964;
+      color: white;
+      font-size: 32px;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      font-weight: bold;
+    }
+
+    .success-title {
+      font-size: 30px;
+      color: #5a22d6;
+      font-weight: 700;
+      margin-bottom: 6px;
+    }
+
+    .success-subtitle {
+      color: #6b6b6b;
+      font-size: 18px;
+    }
+
+    /* CARD */
+
+    .card {
+      background: white;
+      border-radius: 24px;
+      padding: 30px;
+      margin-bottom: 24px;
+    }
+
+    .card-title {
+      font-size: 34px;
+      font-weight: 700;
+      color: #5a22d6;
+      margin-bottom: 30px;
+    }
+
+    .service-grid {
+      display: flex;
+      justify-content: space-between;
+      gap: 25px;
+    }
+
+    .service-column {
+      flex: 1;
+    }
+
+    .item {
+      margin-bottom: 28px;
+    }
+
+    .item-label {
+      color: #777;
+      font-size: 15px;
+      margin-bottom: 8px;
+    }
+
+    .item-value {
+      color: #1f1f1f;
+      font-size: 26px;
+      font-weight: 700;
+      line-height: 1.4;
+    }
+
+    .divider {
+      width: 1px;
+      background: #ececec;
+    }
+
+    /* PAYMENT */
+
+    .payment-wrapper {
+      display: flex;
+      justify-content: space-between;
+      gap: 25px;
+      align-items: center;
+    }
+
+    .payment-total {
+      flex: 1;
+    }
+
+    .payment-summary {
+      margin-top: 18px;
+    }
+
+    .payment-row {
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      margin-bottom: 18px;
+    }
+
+    .payment-row span {
+      font-size: 18px;
+      color: #666;
+    }
+
+    .payment-row strong {
+      font-size: 22px;
+      color: #1f1f1f;
+    }
+
+    .payment-final {
+      border-top: 1px solid #ececec;
+      padding-top: 22px;
+      margin-top: 10px;
+
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+    }
+
+    .payment-final-label {
+      font-size: 24px;
+      font-weight: 700;
+      color: #5a22d6;
+    }
+
+    .payment-final-value {
+      font-size: 42px;
+      font-weight: 800;
+      color: #5a22d6;
+    }
+
+    .payment-method {
+      flex: 1;
+    }
+
+    .payment-badge {
+      display: inline-flex;
+      align-items: center;
+      gap: 12px;
+      border: 1px solid #e5e5e5;
+      padding: 14px 20px;
+      border-radius: 16px;
+      margin-top: 12px;
+      font-size: 26px;
+      font-weight: bold;
+      color: #222;
+    }
+
+    .paid-status {
+      margin-left: 15px;
+      background: #dff7e7;
+      color: #1ea75d;
+      padding: 6px 14px;
+      border-radius: 999px;
+      font-size: 14px;
+      font-weight: bold;
+    }
+
+    /* FOOTER CARD */
+
+    .footer-card {
+      background: #f1ebff;
+      border-radius: 24px;
+      padding: 25px;
+      display: flex;
+      align-items: center;
+      gap: 20px;
+      margin-bottom: 24px;
+    }
+
+    .footer-diarinho {
+      width: 120px;
+    }
+
+    .footer-title {
+      font-size: 36px;
+      color: #5a22d6;
+      font-weight: 700;
+      margin-bottom: 10px;
+    }
+
+    .footer-text {
+      color: #666;
+      line-height: 1.7;
+      font-size: 18px;
+    }
+
+    /* FOOTER */
+
+    .footer {
+      background: linear-gradient(135deg, #5d1ce0, #3f0fb3);
+      padding: 35px 30px;
+      color: white;
+    }
+
+    .footer-content {
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      gap: 20px;
+      flex-wrap: wrap;
+    }
+
+    .footer-app {
+      font-size: 30px;
+      font-weight: 700;
+      color: #6de0ff;
+    }
+
+    .footer-help {
+      text-align: right;
+      font-size: 18px;
+      line-height: 1.6;
+    }
+
+    .footer-bottom {
+      margin-top: 25px;
+      text-align: center;
+      font-size: 14px;
+      opacity: 0.7;
+    }
+
+    /* RESPONSIVE */
+
+    @media(max-width: 640px) {
+
+      .header-content,
+      .service-grid,
+      .payment-wrapper,
+      .footer-card {
+        flex-direction: column;
+      }
+
+      .divider {
+        width: 100%;
+        height: 1px;
+      }
+
+      .title {
+        font-size: 42px;
+      }
+
+      .diarinho {
+        width: 160px;
+      }
+
+      .card-title {
+        font-size: 28px;
+      }
+
+      .item-value {
+        font-size: 22px;
+      }
+
+      .payment-final {
+        flex-direction: column;
+        align-items: flex-start;
+        gap: 10px;
+      }
+
+      .footer-help {
+        text-align: left;
+      }
+    }
+
+  </style>
+
+</head>
+
+<body>
+
+<div class="email-container">
+
+  <!-- HEADER -->
+
+  <div class="header">
+
+    <div class="header-content">
+
+      <div class="header-text">
+
+        <div class="title">
+          {{ __('mail.service_completed.title') }}
+        </div>
+
+        <div class="subtitle">
+          {{ __('mail.service_completed.subtitle') }}
+        </div>
+
+      </div>
+
+      <img
+        src="{{ asset('images/diarinho.png') }}"
+        class="diarinho"
+        alt="Diarinho"
+      />
+
+    </div>
+
+  </div>
+
+  <!-- CONTENT -->
+
+  <div class="content">
+
+    <!-- STATUS -->
+
+    <div class="success-card">
+
+      <div class="success-icon">
+        ✓
+      </div>
+
+      <div>
+
+        <div class="success-title">
+          {{ __('mail.service_completed.payment_confirmed') }}
+        </div>
+
+        <div class="success-subtitle">
+          {{ __('mail.service_completed.payment_confirmed_subtitle') }}
+        </div>
+
+      </div>
+
+    </div>
+
+    <!-- SERVICE -->
+
+    <div class="card">
+
+      <div class="card-title">
+        {{ __('mail.service_completed.service_resume') }}
+      </div>
+
+      <div class="service-grid">
+
+        <div class="service-column">
+
+          <div class="item">
+
+            <div class="item-label">
+              {{ __('mail.service_completed.client') }}
+            </div>
+
+            <div class="item-value">
+              {{ $client_name }}
+            </div>
+
+          </div>
+
+          <div class="item">
+
+            <div class="item-label">
+              {{ __('mail.service_completed.service_date') }}
+            </div>
+
+            <div class="item-value">
+              {{ \Carbon\Carbon::parse($service_date)->format('d/m/Y') }}
+            </div>
+
+          </div>
+
+          <div class="item">
+
+            <div class="item-label">
+              {{ __('mail.service_completed.service_time') }}
+            </div>
+
+            <div class="item-value">
+              {{ substr($start_time, 0, 5) }}
+              às
+              {{ substr($end_time, 0, 5) }}
+            </div>
+
+          </div>
+
+        </div>
+
+        <div class="divider"></div>
+
+        <div class="service-column">
+
+          <div class="item">
+
+            <div class="item-label">
+              {{ __('mail.service_completed.service_address') }}
+            </div>
+
+            <div class="item-value">
+              {{ $address }}
+            </div>
+
+          </div>
+
+        </div>
+
+      </div>
+
+    </div>
+
+    <!-- PAYMENT -->
+
+    <div class="card">
+
+      <div class="card-title">
+        {{ __('mail.service_completed.payment_title') }}
+      </div>
+
+      <div class="payment-wrapper">
+
+        <div class="payment-total">
+
+          <div class="payment-summary">
+
+            <div class="payment-row">
+
+              <span>
+                {{ __('mail.service_completed.total_amount') }}
+              </span>
+
+              <strong>
+                {{ __('mail.currency') }}
+                {{ number_format($total_amount, 2, ',', '.') }}
+              </strong>
+
+            </div>
+
+            <div class="payment-row">
+
+              <span>
+                {{ __('mail.service_completed.service_fee') }}
+              </span>
+
+              <strong>
+                {{ __('mail.currency') }}
+                {{ number_format($service_fee, 2, ',', '.') }}
+              </strong>
+
+            </div>
+
+            <div class="payment-final">
+
+              <span class="payment-final-label">
+                {{ __('mail.service_completed.final_amount') }}
+              </span>
+
+              <span class="payment-final-value">
+                {{ __('mail.currency') }}
+                {{ number_format($final_amount, 2, ',', '.') }}
+              </span>
+
+            </div>
+
+          </div>
+
+        </div>
+
+        <div class="divider"></div>
+
+        <div class="payment-method">
+
+          <div class="item-label">
+            {{ __('mail.service_completed.payment_method') }}
+          </div>
+
+          <div class="payment-badge">
+
+            {{ $payment_method }}
+
+            <span class="paid-status">
+              {{ __('mail.service_completed.paid') }}
+            </span>
+
+          </div>
+
+        </div>
+
+      </div>
+
+    </div>
+
+    <!-- FOOTER CARD -->
+
+    <div class="footer-card">
+
+      <img
+        src="{{ asset('images/diarinho.png') }}"
+        class="footer-diarinho"
+        alt="Diarinho"
+      />
+
+      <div>
+
+        <div class="footer-title">
+          {{ __('mail.service_completed.footer_title') }}
+        </div>
+
+        <div class="footer-text">
+          {{ __('mail.service_completed.footer_description') }}
+        </div>
+
+      </div>
+
+    </div>
+
+  </div>
+
+  <!-- FOOTER -->
+
+  <div class="footer">
+
+    <div class="footer-content">
+
+      <div>
+
+        <div class="footer-app">
+          diariaapp
+        </div>
+
+      </div>
+
+      <div class="footer-help">
+
+        {{ __('mail.service_completed.footer_help') }}<br>
+
+        {{ __('mail.service_completed.footer_contact') }}<br>
+
+        (11) 99999-9999
+
+      </div>
+
+    </div>
+
+    <div class="footer-bottom">
+      {{ __('mail.service_completed.footer_note') }}
+    </div>
+
+  </div>
+
+</div>
+
+</body>
+
+</html>

+ 212 - 130
resources/views/emails/send_code.blade.php

@@ -1,138 +1,220 @@
 <!DOCTYPE html>
 <html lang="pt-BR">
+
 <head>
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <title>{{ __('mail.send_code.subject') }}</title>
-    <style>
-        * { box-sizing: border-box; margin: 0; padding: 0; }
-
-        body {
-            background-color: #f4f4f7;
-            font-family: 'Segoe UI', Arial, sans-serif;
-            color: #333333;
-        }
-
-        .wrapper {
-            width: 100%;
-            padding: 40px 16px;
-        }
-
-        .card {
-            max-width: 520px;
-            margin: 0 auto;
-            background-color: #ffffff;
-            border-radius: 12px;
-            overflow: hidden;
-            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
-        }
-
-        .header {
-            background-color: #1a6fa8;
-            padding: 32px 40px;
-            text-align: center;
-        }
-
-        .header h1 {
-            color: #ffffff;
-            font-size: 22px;
-            font-weight: 700;
-            letter-spacing: 0.5px;
-        }
-
-        .header p {
-            color: #cce3f5;
-            font-size: 13px;
-            margin-top: 4px;
-        }
-
-        .body {
-            padding: 36px 40px;
-            text-align: center;
-        }
-
-        .body p {
-            font-size: 15px;
-            line-height: 1.6;
-            color: #555555;
-        }
-
-        .code-box {
-            display: inline-block;
-            margin: 28px 0;
-            padding: 18px 40px;
-            background-color: #f0f7ff;
-            border: 2px dashed #1a6fa8;
-            border-radius: 10px;
-        }
-
-        .code-box span {
-            display: block;
-            font-size: 42px;
-            font-weight: 800;
-            letter-spacing: 10px;
-            color: #1a6fa8;
-        }
-
-        .expiry {
-            font-size: 13px;
-            color: #999999;
-            margin-top: 8px;
-        }
-
-        .footer {
-            background-color: #f9f9fb;
-            border-top: 1px solid #eeeeee;
-            padding: 24px 40px;
-            text-align: center;
-        }
-
-        .footer p {
-            font-size: 12px;
-            color: #aaaaaa;
-            line-height: 1.6;
-        }
-
-        .footer strong {
-            color: #888888;
-        }
-    </style>
+
+    <title>
+        {{ __('mail.send_code.subject') }}
+    </title>
 </head>
-<body>
-    <div class="wrapper">
-        <div class="card">
-
-            <div class="header">
-                <h1>Diaria App</h1>
-                <p>{{ __('mail.send_code.header_subtitle') }}</p>
-            </div>
-
-            <div class="body">
-                @if (!empty($recipientName))
-                    <p>{{ __('mail.send_code.greeting', ['name' => $recipientName]) }}</p>
-                @else
-                    <p>{{ __('mail.send_code.greeting_anonymous') }}</p>
-                @endif
-
-                <p style="margin-top: 12px;">{{ __('mail.send_code.body_intro') }}</p>
-
-                <div class="code-box">
-                    <span>{{ $code }}</span>
-                </div>
-
-                <p style="margin-top: 20px; font-size: 13px; color: #999;">
-                    {{ __('mail.send_code.ignore_notice') }}
-                </p>
-            </div>
-
-            <div class="footer">
-                <p>
-                    &copy; {{ date('Y') }} <strong>Diaria App</strong><br />
-                    {{ __('mail.send_code.footer_note') }}
-                </p>
-            </div>
-
-        </div>
-    </div>
+
+<body style="margin:0;padding:0;background:#f5f5f7;font-family:Arial,Helvetica,sans-serif;">
+
+    <table width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#f5f5f7">
+        <tr>
+            <td align="center" style="padding:25px;">
+
+                <!-- CONTAINER -->
+                <table width="650" cellpadding="0" cellspacing="0" border="0" bgcolor="#ffffff"
+                    style="border-radius:24px;overflow:hidden;">
+
+                    <!-- HEADER -->
+                    <tr>
+                        <td style="background:#5a22d6;padding:50px 40px;color:white;">
+
+                            <table width="100%">
+                                <tr>
+
+                                    <!-- LEFT -->
+                                    <td valign="middle">
+
+                                        <div style="font-size:52px;font-weight:bold;line-height:1.1;">
+                                            {{ __('mail.send_code.subject') }}
+                                        </div>
+
+                                        <div style="font-size:20px;margin-top:20px;line-height:1.6;">
+                                            {{ __('mail.send_code.header_subtitle') }}
+                                        </div>
+
+                                    </td>
+
+                                    <!-- RIGHT -->
+                                    <td width="220" align="right" valign="middle">
+
+                                        <img src="{{ asset('images/diarinho_email_code.svg') }}" width="110" alt="Diarinho"
+                                            style="display:block;border:0;">
+
+                                    </td>
+
+                                </tr>
+                            </table>
+
+                        </td>
+                    </tr>
+
+                    <!-- CONTENT -->
+                    <tr>
+                        <td style="padding:30px;background:#f5f5f7;">
+
+                            <!-- MAIN CARD -->
+                            <table width="100%" bgcolor="#ffffff"
+                                style="border-radius:24px;padding:35px;margin-bottom:25px;">
+
+                                <!-- GREETING -->
+                                <tr>
+                                    <td>
+
+                                        @if (!empty($recipientName))
+                                            <div style="font-size:34px;font-weight:bold;color:#222;line-height:1.4;">
+                                                {{ __('mail.send_code.greeting', ['name' => $recipientName]) }}
+                                            </div>
+                                        @else
+                                            <div style="font-size:34px;font-weight:bold;color:#222;line-height:1.4;">
+                                                {{ __('mail.send_code.greeting_anonymous') }}
+                                            </div>
+                                        @endif
+
+                                    </td>
+                                </tr>
+
+                                <!-- BODY -->
+                                <tr>
+                                    <td style="padding-top:25px;font-size:20px;color:#666;line-height:1.8;">
+                                        {{ __('mail.send_code.body_intro') }}
+                                    </td>
+                                </tr>
+
+                                <!-- CODE -->
+                                <tr>
+                                    <td align="center" style="padding-top:35px;">
+
+                                        <table cellpadding="0" cellspacing="0" border="0" bgcolor="#f3ecff"
+                                            style="border-radius:24px;padding:35px 45px;">
+
+                                            <tr>
+
+                                                <td align="center">
+
+                                                    <div
+                                                        style="font-size:68px;font-weight:800;color:#5a22d6;letter-spacing:16px;">
+                                                        {{ $code }}
+                                                    </div>
+
+                                                </td>
+
+                                            </tr>
+
+                                        </table>
+
+                                    </td>
+                                </tr>
+
+                                <!-- EXPIRATION -->
+                                <tr>
+                                    <td align="center"
+                                        style="padding-top:28px;font-size:17px;color:#777;line-height:1.7;">
+
+                                        {{ __('mail.send_code.expiry_notice') }}
+
+                                    </td>
+                                </tr>
+
+                                <!-- WARNING -->
+                                <tr>
+                                    <td style="padding-top:30px;">
+
+                                        <table width="100%" bgcolor="#fff8e8"
+                                            style="border-radius:18px;padding:22px;">
+
+                                            <tr>
+
+                                                <td style="font-size:17px;color:#9a6a00;line-height:1.8;">
+
+                                                    {{ __('mail.send_code.ignore_notice') }}
+
+                                                </td>
+
+                                            </tr>
+
+                                        </table>
+
+                                    </td>
+                                </tr>
+
+                            </table>
+
+                            <!-- FOOTER CARD -->
+                            <table width="100%" bgcolor="#f1ebff"
+                                style="border-radius:24px;padding:25px;margin-bottom:25px;">
+
+                                <tr>
+
+                                    <td width="130" valign="middle">
+
+                                        <img src="{{ asset('images/diarinho_email_welcome.svg') }}" class="diarinho"
+                                            alt="Diarinho" />
+
+                                    </td>
+
+                                    <td valign="middle">
+
+                                        <div style="font-size:34px;font-weight:bold;color:#5a22d6;">
+
+                                            {{ __('mail.send_code.footer_title') }}
+
+                                        </div>
+
+                                        <div style="font-size:18px;color:#666;line-height:1.7;margin-top:10px;">
+
+                                            {{ __('mail.send_code.footer_note') }}
+
+                                        </div>
+
+                                    </td>
+
+                                </tr>
+
+                            </table>
+
+                        </td>
+                    </tr>
+
+                    <!-- FOOTER -->
+                    <tr>
+                        <td style="background:#5a22d6;padding:35px;color:white;">
+
+                            <table width="100%">
+
+                                <tr>
+                                    <!-- CONTACT -->
+                                    <td align="right" style="font-size:18px;line-height:1.7;">
+
+                                        {{ __('mail.send_code.footer_note') }}
+
+                                    </td>
+
+                                </tr>
+
+                            </table>
+
+                            <!-- BOTTOM -->
+                            <div style="margin-top:25px;text-align:center;font-size:13px;opacity:0.7;">
+
+                                © {{ date('Y') }}
+
+                            </div>
+
+                        </td>
+                    </tr>
+
+                </table>
+
+            </td>
+        </tr>
+    </table>
+
 </body>
+
 </html>

+ 276 - 0
resources/views/emails/send_code.html

@@ -0,0 +1,276 @@
+<!DOCTYPE html>
+<html lang="pt-BR">
+
+<head>
+  <meta charset="UTF-8">
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
+  <title>{{ __('mail.send_code.subject') }}</title>
+</head>
+
+<body style="margin:0;padding:0;background:#f4f4f7;font-family:Arial,Helvetica,sans-serif;">
+
+  <table width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#f4f4f7">
+    <tr>
+      <td align="center" style="padding:30px 15px;">
+
+        <!-- CONTAINER -->
+        <table width="650" cellpadding="0" cellspacing="0" border="0"
+          style="background:#ffffff;border-radius:24px;overflow:hidden;">
+
+          <!-- HEADER -->
+          <tr>
+            <td
+              style="background:linear-gradient(135deg,#4f1fd6,#7b2cff);padding:50px 40px;">
+
+              <table width="100%">
+
+                <tr>
+
+                  <!-- LEFT -->
+                  <td valign="middle">
+
+                    <div
+                      style="font-size:56px;font-weight:800;line-height:1.1;color:#ffffff;">
+
+                      {{ __('mail.send_code.title') }}
+
+                    </div>
+
+                    <div
+                      style="font-size:22px;line-height:1.6;color:#e8dbff;margin-top:22px;">
+
+                      {{ __('mail.send_code.body_intro') }}
+
+                    </div>
+
+                  </td>
+
+                  <!-- RIGHT -->
+                  <td width="240" align="right" valign="middle">
+
+                    <img
+                      src="https://i.imgur.com/8Km9tLL.png"
+                      width="220"
+                      alt="Diarinho"
+                      style="display:block;border:0;"
+                    >
+
+                  </td>
+
+                </tr>
+
+              </table>
+
+            </td>
+          </tr>
+
+          <!-- CONTENT -->
+          <tr>
+            <td style="padding:35px;background:#f5f5f7;">
+
+              <!-- CARD -->
+              <table width="100%" cellpadding="0" cellspacing="0" border="0"
+                style="background:#ffffff;border-radius:24px;padding:35px;">
+
+                <!-- GREETING -->
+                <tr>
+                  <td>
+
+                    @if (!empty($recipientName))
+
+                    <div
+                      style="font-size:42px;font-weight:700;color:#1f1f1f;line-height:1.3;">
+
+                      {{ __('mail.send_code.greeting', ['name' => $recipientName]) }}
+
+                    </div>
+
+                    @else
+
+                    <div
+                      style="font-size:42px;font-weight:700;color:#1f1f1f;line-height:1.3;">
+
+                      {{ __('mail.send_code.greeting_anonymous') }}
+
+                    </div>
+
+                    @endif
+
+                  </td>
+                </tr>
+
+                <!-- TEXT -->
+                <tr>
+                  <td
+                    style="padding-top:25px;font-size:22px;line-height:1.8;color:#555555;">
+
+                    {{ __('mail.send_code.code_instruction') }}
+
+                  </td>
+                </tr>
+
+                <!-- CODE BOX -->
+                <tr>
+                  <td align="center" style="padding-top:35px;">
+
+                    <table cellpadding="0" cellspacing="0" border="0"
+                      style="background:#f5efff;border-radius:24px;padding:35px 40px;width:100%;">
+
+                      <tr>
+
+                        <td align="center">
+
+                          <div
+                            style="font-size:82px;font-weight:800;letter-spacing:18px;color:#5a22d6;">
+
+                            {{ $code }}
+
+                          </div>
+
+                        </td>
+
+                      </tr>
+
+                    </table>
+
+                  </td>
+                </tr>
+
+                <!-- EXPIRATION -->
+                <tr>
+                  <td align="center"
+                    style="padding-top:30px;font-size:18px;color:#666666;line-height:1.7;">
+
+                    ⏰ {{ __('mail.send_code.expiry_notice') }}
+
+                  </td>
+                </tr>
+
+                <!-- ALERT -->
+                <tr>
+                  <td style="padding-top:30px;">
+
+                    <table width="100%"
+                      style="background:#fff8e7;border-radius:18px;padding:22px;">
+
+                      <tr>
+
+                        <td
+                          style="font-size:18px;color:#9c6a00;line-height:1.7;">
+
+                          ⚠️ {{ __('mail.send_code.ignore_notice') }}
+
+                        </td>
+
+                      </tr>
+
+                    </table>
+
+                  </td>
+                </tr>
+
+              </table>
+
+              <!-- FOOTER CARD -->
+              <table width="100%" cellpadding="0" cellspacing="0" border="0"
+                style="background:#f3ecff;border-radius:24px;padding:25px;margin-top:25px;">
+
+                <tr>
+
+                  <!-- IMAGE -->
+                  <td width="140" valign="middle">
+
+                    <img
+                      src="https://i.imgur.com/7uX7N4F.png"
+                      width="120"
+                      alt="Diarinho"
+                      style="display:block;border:0;"
+                    >
+
+                  </td>
+
+                  <!-- TEXT -->
+                  <td valign="middle">
+
+                    <div
+                      style="font-size:34px;font-weight:700;color:#5a22d6;">
+
+                      {{ __('mail.send_code.footer_title') }}
+
+                    </div>
+
+                    <div
+                      style="font-size:20px;line-height:1.7;color:#666666;margin-top:10px;">
+
+                      {{ __('mail.send_code.footer_description') }}
+
+                    </div>
+
+                  </td>
+
+                </tr>
+
+              </table>
+
+            </td>
+          </tr>
+
+          <!-- FOOTER -->
+          <tr>
+            <td
+              style="background:linear-gradient(135deg,#4f1fd6,#7b2cff);padding:35px 30px;">
+
+              <table width="100%">
+
+                <tr>
+
+                  <!-- BRAND -->
+                  <td valign="top">
+
+                    <div
+                      style="font-size:34px;font-weight:800;color:#6de0ff;">
+
+                      diariaapp
+
+                    </div>
+
+                  </td>
+
+                  <!-- CONTACT -->
+                  <td align="right"
+                    style="font-size:18px;color:#ffffff;line-height:1.8;">
+
+                    {{ __('mail.send_code.footer_help') }}<br>
+
+                    {{ __('mail.send_code.footer_contact') }}<br>
+
+                    (11) 99999-9999
+
+                  </td>
+
+                </tr>
+
+              </table>
+
+              <!-- BOTTOM -->
+              <div
+                style="margin-top:28px;text-align:center;font-size:14px;color:#d6c5ff;line-height:1.7;">
+
+                © {{ date('Y') }} Diaria App<br>
+
+                {{ __('mail.send_code.footer_note') }}
+
+              </div>
+
+            </td>
+          </tr>
+
+        </table>
+
+      </td>
+    </tr>
+  </table>
+
+</body>
+
+</html>

Деякі файли не було показано, через те що забагато файлів було змінено