PHP code example of yieldstudio / laravel-sendinblue-notifier

1. Go to this page and download the library: Download yieldstudio/laravel-sendinblue-notifier library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?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.');
    }
}
shell
php artisan vendor:publish --provider="YieldStudio\LaravelSendinblueNotifier\SendinblueNotifierServiceProvider" --tag="config"