PHP code example of bhekor / laravel-brevo

1. Go to this page and download the library: Download bhekor/laravel-brevo 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/ */

    

bhekor / laravel-brevo example snippets


Mail::to('[email protected]')->send(new OrderShipped());

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;

class OrderShipped extends Mailable
{
    use Queueable, SerializesModels;

    public function build()
    {
        return $this->markdown('emails.orders.shipped')
                    ->with([
                        'order' => $this->order,
                    ]);
    }
}

Brevo::email()->send(new OrderShipped());

Route::brevoWebhooks('/brevo/webhook');
bash
php artisan vendor:publish --tag=brevo-config
bash
npm install --save-dev @vueuse/core chart.js
php artisan vendor:publish --tag=brevo-assets

tests/
├── Feature/
│   ├── MailTransportTest.php
│   └── WebhookTest.php
└── Unit/
    ├── BrevoClientTest.php
    ├── EventMapperTest.php
    ├── MailTransportTest.php
    ├── TransactionalEmailTest.php
    └── WebhookControllerTest.php