laravel-mail-templates/src/MailTemplatesChannel.php

29 lines
635 B
PHP

<?php
namespace Bluesquare\MailTemplates;
use Bluesquare\MailTemplates\Providers\TemplateMailProvider;
use Illuminate\Notifications\Notification;
class MailTemplatesChannel
{
protected $provider;
public function __construct(TemplateMailProvider $provider)
{
$this->provider = $provider;
}
/**
* @param $notifiable
* @param Notification $notification
* @throws MailTemplatesException
*/
public function send($notifiable, Notification $notification)
{
$template = $notification->toTemplate($notifiable);
$this->provider->send($template, $notifiable);
}
}