quartzy/php-email
最新稳定版本:0.6.0
Composer 安装命令:
composer require quartzy/php-email
包简介
A domain model for describing emails that is indifferent towards sending methods.
关键字:
README 文档
README
This is a domain-driven library for defining emails in PHP.
Php Email brings three major benefits over other similar libraries:
- Focusing on new versions of PHP. By using the newer versions of PHP (5.6+) we can leverage great features such as splat parameters and better type hinting.
- Focusing on only the email, instead of transmission. In a domain-driven world, emails can and should exist separately from the delivery mechanism. By separating these concerns, this library decreases the size and complexity of the domain, while giving developers greater flexibility in how they use the library.
- Flexible content definitions. Emails have gone from a simple text string to highly stylized HTML to now just being templates stored in third-party services. Existing libraries do not provide enough flexibility to support everything developers need. Php Email attempts to correct this by creating guidelines for possible email content, but also allowing developers to define what they need.
Install
With Composer
composer require quartzy/php-email
Usage
Building an email with HTML and text content would look like:
<?php use PhpEmail\Attachment\FileAttachment; use PhpEmail\EmailBuilder; use PhpEmail\Content\SimpleContent; $email = EmailBuilder::email() ->withSubject('Welcome!') ->withContent(SimpleContent::text('Start your free trial now!!!')) ->from('me@test.com') ->to('you@yourbusiness.com') ->cc('cc@test.com') ->bcc('bcc@test.com') ->replyTo('reply.to@test.com') ->attach(new FileAttachment('/path/to/my/file.txt')) ->build();
Sending a templated email:
<?php use PhpEmail\EmailBuilder; use PhpEmail\Content\TemplatedContent; $content = new TemplatedContent('my_templates_id', ['firstName' => 'Billy']); $email = EmailBuilder::email() ->withSubject('Welcome!') ->withContent($content) ->from('me@test.com') ->to('you@yourbusiness.com') ->build();
Change log
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING and CONDUCT for details.
Security
If you discover any security related issues, please email opensource@quartzy.com instead of using the issue tracker.
Credits
License
The Apache License, v2.0. Please see License File for more information.
quartzy/php-email 适用场景与选型建议
quartzy/php-email 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9.47k 次下载、GitHub Stars 达 5, 最近一次更新时间为 2017 年 07 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「email」 「domain-driven」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 quartzy/php-email 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 quartzy/php-email 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 quartzy/php-email 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Domain Driven Design related Classes and Utilities
Infrastructure and testing helpers for creating CQRS and event sourced applications.
Infrastructure and testing helpers for creating CQRS and event sourced applications.
Symfony bundle for broadway/broadway.
Symfony bundle for micro-module/broadway.
Extensible library for building notifications and sending them via different delivery channels.
统计信息
- 总下载量: 9.47k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 16
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2017-07-25