PHP code example of wednesdev / mail

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

    

wednesdev / mail example snippets


use Wednesdev\Mail\Models\EmailTemplate;

$template = EmailTemplate::create([
    'name' => 'welcome_email',
    'description' => 'Welcome email for new users',
]);

$template->translations()->create([
    'locale' => 'en',
    'subject' => 'Welcome to Our Platform, {name}!',
    'body' => '<h1>Welcome, {name}!</h1><p>We're excited to have you on board.</p>',
]);

use Wednesdev\Mail\Facades\Email;

Email::send($user, 'welcome_email', '[email protected]', ['name' => 'John Doe'], 'en');
bash
php artisan vendor:publish --provider="Wednesdev\Mail\Providers\MailServiceProvider"