<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
yieldstudio / laravel-sendinblue-notifier example snippets
namespace App\Notifications;
use Illuminate\Notifications\Notification;
use YieldStudio\LaravelSendinblueNotifier\SendinblueEmailChannel;
use YieldStudio\LaravelSendinblueNotifier\SendinblueEmailMessage;
class OrderConfirmation extends Notification
{
public function via(): array
{
return [SendinblueEmailChannel::class];
}
public function toSendinblueEmail($notifiable): SendinblueEmailMessage
{
return (new SendinblueEmailMessage())
->templateId(1)
->to($notifiable->firstname, $notifiable->email)
->params(['order_ref' => 'N°0000001']);
}
}
namespace App\Notifications;
use Illuminate\Notifications\Notification
use YieldStudio\LaravelSendinblueNotifier\SendinblueSmsChannel;
use YieldStudio\LaravelSendinblueNotifier\SendinblueSmsMessage;
class OrderConfirmation extends Notification
{
public function via()
{
return [SendinblueSmsChannel::class];
}
public function toSendinblueSms($notifiable): SendinblueSmsMessage
{
return (new SendinblueSmsMessage())
->from('YIELD')
->to('+33626631711')
->content('Your order is confirmed.');
}
}