Initial commit
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
namespace App\Notifications;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
|
||||
class compra 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('Credenciales '.$this->notificacion['servicio'])
|
||||
->greeting('Hola,'.$this->notificacion['cliente'])
|
||||
->line('Sus credenciales de acceso '.$this->notificacion['servicio'])
|
||||
->action('Ver credenciales', url($this->notificacion['enlace']))
|
||||
->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'],
|
||||
'enlace' =>$this->notificacion['enlace'],
|
||||
|
||||
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user