Files
sirpremiumv2/app/Notifications/Vencimiento.php
T
2023-11-07 22:43:10 +00:00

72 lines
1.8 KiB
PHP
Executable File

<?php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class Vencimiento extends Notification implements ShouldQueue
{
use Queueable;
public $notificacion;
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct($notificacion)
{
$this-> notificacion = $notificacion;
}
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return ['database','mail'];
}
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage)
->subject('Aviso de renovación')
->greeting('Hola,'.$this->notificacion['cliente'])
->line('Su servicio de '.$this->notificacion['servicio'].' esta proximo a vencer.')
->action('Renovar', url('/'))
->line('Gracias por usar SirPremium!');
}
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @return array
*/
public function toArray($notifiable)
{
return [
'fecha_final' => $this->notificacion['fecha_final'],
'cliente' => $this->notificacion['cliente'],
'servicio' => $this->notificacion['servicio'],
'tipo' => $this->notificacion['tipo'],
'vendedor' =>$this->notificacion['vendedor'],
];
}
}