Add and manager email template for Laravel
- Email template table
- Add/Edit/Manager email template
- Mail list send history
- Send mail with cronjob
- Install package
composer require tadcms/laravel-email-template
- Migration
php artisan migrate
- Setup The Scheduler: Add command to your server
* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
View more: Starting The Scheduler
use Tadcms\EmailTemplate\Models\EmailTemplate;
EmailTemplate::create([
'code' => 'test_mail',
'subject' => 'Send email test for {name}',
'body' => '<p>Hello {name},</p>
<p>This is the test email</p>',
'params' => [
'name' => 'Your Name',
],
]);
use Tadcms\EmailTemplate\EmailService;
EmailService::make()
->withTemplate('test_mail')
->setEmails('test@example.com')
->setParams([
'name' => 'The Anh',
])
->send();
The package is open-sourced software licensed under the MIT license.