PHP code example of goennounce / laravel-email-templates

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

    

goennounce / laravel-email-templates example snippets


'providers' => [
    # ...
    GoEnnounce\LaravelEmailTemplates\ServiceProvider::class,
],

'aliases' => [
    # ...
    'EmailTemplate' => GoEnnounce\LaravelEmailTemplates\Facades\EmailTemplates::class,
]

$mail = \EmailTemplate::fetch('registration', ['name' => 'Jon']);
 
\Mail::to('[email protected]')->send($mail);

$mail = \EmailTemplate::fetch('registration', ['name' => 'Jon'], 'es');
 
\Mail::to('[email protected]')->send($mail);

$mail = \EmailTemplate::fetch('registration', ['first_name' => 'Jon']);
 
$mail->with('last_name', 'Braud');
 
$mail->with([
    'verify_url'=> 'https:/....',
    'signup_time' => \Carbon\Carbon::now()->toDateTimeString()
]);
 
\Mail::to('[email protected]')->send($mail);

$ php artisan migrate