urbanindo/yii2-mail-object
Composer 安装命令:
composer require urbanindo/yii2-mail-object
包简介
This wraps Yii2 mailer as an object
README 文档
README
This wraps mail object that can be instantiated rather standalone.
Usage
Create new mail object class using MailObject.
e.g.
class DummyMail extends MailObject { protected function getSubject(): string { return 'Hello, World!'; } protected function getContentParams(): array { return [ 'recipientName' => 'Jane Doe', ]; } protected function getRecipient(): array { return [ 'jane.doe@example.com' => 'Jane Doe', ]; } }
Create html.php and text.php for HTML-formatted and plain text email respectively.
To send the object, simply.
$mail = new DummyMail(); $mail->send();
Testing
To run testing, execute
./vendor/bin/phing test
统计信息
- 总下载量: 12.6k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-06-22