PHP code example of laravel-enso / mails

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

    

laravel-enso / mails example snippets


'brand' => [
    'name' => 'Solarlink',
    'url' => 'https://solarlink.ro',
    'logo' => 'https://solarlink.ro/images/mail-logo.png',
    'max_width' => 160,
    'max_height' => 34,
    'label' => 'solarlink.ro',
],

'text' => [
    'font_family' => 'Poppins, Avenir, Helvetica, Arial, sans-serif',
    'surface' => '#FFFFFF',
],

'colors' => [
    'primary' => '#4aac2a',
    'accent' => '#eb3a16',
    'link' => '#eb3a16',
    'dark' => '#121933',
],

'preview' => [
    'enabled' => env('ENSO_MAILS_PREVIEW', env('APP_ENV') !== 'production'),
],

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use LaravelEnso\Mails\Preview\PreviewDefinition;
use LaravelEnso\Mails\Preview\PreviewRegistry;

class MailServiceProvider extends ServiceProvider
{
    public function boot(PreviewRegistry $registry): void
    {
        $registry->register(new PreviewDefinition(
            key: 'reset-password',
            name: 'Reset Password',
            view: 'laravel-enso/core::emails.reset',
            data: [
                'name' => 'Jane Doe',
                'url' => 'https://example.test/password/reset/token',
            ],
            section: PreviewDefinition::AppSpecific,
        ));
    }
}
bash
php artisan vendor:publish --tag=mails-config
text
config/enso/mails.php
bash
php artisan vendor:publish --tag=mails-views
bash
php artisan enso:mails:preview --list
bash
php artisan enso:mails:preview --output=/tmp/mail-previews
text
resources/mjml/html/message.mjml.blade.php
text
resources/views/vendor/mail/html/message.blade.php
resources/views/vendor/mail/html/message-wide.blade.php
resources/views/vendor/mail/html/transactional.blade.php
resources/views/vendor/mail/html/action-
bash
php artisan enso:mails:preview
php artisan enso:mails:preview --list
php artisan enso:mails:preview {preview}
php artisan enso:mails:preview --output=/path/to/output