pigeon/pigeon
Composer 安装命令:
composer require pigeon/pigeon
包简介
Pigeon lets you easily manage your outbound email, push notifications and SMS. Visit https://pigeonapp.io for more details.
README 文档
README
Pigeon lets you easily manage your outbound email, push notifications and SMS. Visit https://pigeonapp.io for more details.
Installation
The recommended way to install Pigeon is through Composer.
$ composer require pigeon/pigeon
Usage
$pigeon = new Pigeon\Client('PIGEON_PUBLIC_KEY', 'PIGEON_PRIVATE_KEY');
Public (PIGEON_PUBLIC_KEY) and private (PIGEON_PRIVATE_KEY) keys would be retrieved from the env variables if not passed.
Prepare for the delivery
$message_identifier = 'message-identifier'; $parcels = ['to' => 'john@example.com'];
- Message identifier is used to identify the message. Grab this from your Pigeon dashboard.
- Parcels array accepts
to,cc,bccanddata.
Deliver
$pigeon->deliver($message_identifier, $parcels);
Parcel sample (Single recipient)
$parcels = [ 'to' => 'John Doe <john@example.com>', 'cc' => [ 'admin@example.com', 'Sales Team <sales@example.com>' ], 'data' => [ // template variables are added here 'name' => 'John' ], 'attachments' => [ // `file` can be local file path, remote URL or a file pointer resource [ 'file' => '/path/to/image.png', 'name' => 'Logo' ], [ 'file' => 'https://example.com/guide.pdf', 'name' => 'Guide' ] ] ];
Parcel sample (Multiple recipients)
$parcels = [ [ 'to' => 'John Doe <john@example.com>', 'data' => [ // template variables are added here 'name' => 'John' ] ], [ 'to' => 'Jane Doe <jane@example.com>', 'data' => [ // template variables are added here 'name' => 'Jane' ] ], ];
Framework integration
Contributing
You can contribute in one of two ways:
- File bug reports using the issue tracker.
- Answer questions or fix bugs on the issue tracker.
This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
License
The composer package is available as open source under the terms of the MIT License.
Code of Conduct
Everyone interacting in the Pigeon project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
统计信息
- 总下载量: 43
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-01-26