fatihirday/mail-template
最新稳定版本:v0.3.4
Composer 安装命令:
composer require fatihirday/mail-template
包简介
Laravel Mail blade from DB
README 文档
README
Installation
composer require fatihirday/mail-template
php artisan vendor:publish --provider="Fatihirday\MailTemplate\MailTemplateServiceProvider"
php artisan migrate
MailTemplate
Mail template default variables
$isRtl$languageCode$baseUrl=>APP_URLin the.envfile
MailLanguage
ExampleMail.php
<?php
class ExampleMail extends Mailable
{
use Queueable;
use SerializesModels;
use MailViewTemplate;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct(
protected readonly string $languageCode = 'en',
protected readonly array $data = []
)
{
//
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->builder('default', $this->languageCode);
// Or custom subject
// return $this->builder('default', $this->languageCode, 'custom subject');
}
}
Sender
$data = [
'name' => 'fatih',
'items' => ['a', 'b', 'c']
];
return Mail::to('fatihirday@gmail.com')
->send(new ExampleMail('tr', $data));
Mail Cache Clear
php artisan mail:cache:clear
统计信息
- 总下载量: 320
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-11-28

