PHP code example of muratbsts / mail-template

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

    

muratbsts / mail-template example snippets



...
'providers' => [
    ...
    Muratbsts\MailTemplate\Providers\MailTemplateServiceProvider::class,
    ...
],
...


return [
    'template'  => 'default',
    'footnote'  => null,

    'logo'      => [
        'path'  => null,
        'link'  => null,
    ],

    'from'      => '[email protected]',
    'cc'        => null,
    'bcc'       => null,
];



use Muratbsts\MailTemplate\MailTemplate as MailTemplate;

class XyzController extends Controller
{
    public function send()
    {
        $mailer = app()->make(MailTemplate::class);
    
        $mailer->send('emails.welcome', [
            'button' => [
                'text' => 'Sign up now!',
                'link' => 'https://google.com',
            ]
        ], function ($message) use ($user) {
            $message->to($user->email, $user->name)->subject('Welcome!');
        });
    }
}

@extends('mailtemplate::emails.{$template}')

@section('content')
    <p class="paragraph">Hi,</p>
    <p class="paragraph">Cultivar arabica, that, milk robust aroma redeye skinny arabica. Qui skinny, americano barista roast crema single shot filter. To go decaffeinated to go, mug iced sit plunger pot con panna decaffeinated barista sugar café au lait. Cup mazagran milk grinder, coffee steamed fair trade and whipped con panna aromatic.</p>
    <p class="paragraph">Take care,</p>
    <p class="paragraph">Murat</p>
@endsection