PHP code example of recca0120 / email-template

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

    

recca0120 / email-template example snippets


\Recca0120\EmailTemplate\EmailTemplate::create([
    'slug' => 'my first template'
    'from_address' => '[email protected]',
    'from_name' => 'admin',
    'content' => 'my name is: {{$name}}'
]);

$mailer = app()->make(\Recca0120\EmailTemplate\Mailer::class);
$slug = 'my first template';
$mailer->send($slug, ['name' => 'recca0120'], function($m) {
    $m->to('[email protected]');
});