PHP code example of korridor / symfony-scaleway-tem-mailer

1. Go to this page and download the library: Download korridor/symfony-scaleway-tem-mailer 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/ */

    

korridor / symfony-scaleway-tem-mailer example snippets


use Korridor\SymfonyScalewayTemMailer\Transport\ScalewayApiTransport;
use Korridor\SymfonyScalewayTemMailer\Transport\ScalewaySmtpTransport;

    // ..

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot(): void
    {
        // ...
        Mail::extend('scaleway-api', function (array $config = []) {
            return new ScalewayApiTransport($config['token'], $config['region'], $config['project_id']);
        });
        Mail::extend('scaleway-smtp', function (array $config = []) {
            return new ScalewaySmtpTransport($config['token'], $config['region'], $config['project_id']);
        }); 
    }


'scaleway' => [
    'transport' => 'scaleway-api',
    'region' => env('MAIL_SCALEWAY_REGION', 'fr-par'),
    'token' => env('MAIL_SCALEWAY_TOKEN'),
    'project_id' => env('MAIL_SCALEWAY_PROJECT_ID'),
],

'scaleway' => [
    'transport' => 'scaleway-smtp',
    'region' => env('MAIL_SCALEWAY_REGION', 'fr-par'),
    'token' => env('MAIL_SCALEWAY_TOKEN'),
    'project_id' => env('MAIL_SCALEWAY_PROJECT_ID'),
],