flyingpiranhas/mailer
Composer 安装命令:
composer require flyingpiranhas/mailer
包简介
The flyingpiranhas mailer library uses SwiftMailer to send, archive and queue emails in a fast and secure manner. See official documentation for demos.
README 文档
README
###FlyingPiranhas Mailer library
###This is not for any kind of use. It's just here for composer testing, and for development purposes. I'm still heavily working on this - it's actually a port of a library I already built before.
####Introduction The FlyingPiranhas mailer library is part of the FlyingPiranhas wireframework. It helps me develop websites quickly and safely, so I thought I'd share it with the world. For more information on it and its authors, head over to the home page and read up.
####Mailer This is the mailer library, meaning it focuses solely on advanced emailing functionality.
####Usage
Before sending, you must call Mailer::setDeveloperRecipient() on the current instance of the Mailer class.
This is a safety measure - it enables sending. If you pass in an email as the parameter, that email will
override all recipients and receive emails instead of the originally intended ones. This is useful for testing
bulk email functionality without quasi-spamming your users. To deactivate this measure, simply call the method
with no parameters.
Mailer supports "express email" functionality via the method expressMail.
This method requires an array containing "to" and "body", and optionally "subject" and "from".
If "from" is omitted, it should be provided via the static method Mailer::setDefaultSender()
The expressMail method works without a Repo by default, as long as you leave the second param
at false. As soon as the second param is true, it will try to archive the sent email and will fail unless
you provide a Repo class for it to work with. It is important to note that the email still gets sent,
only the archiving fails with an exception.
Regular email sending works via Mailer::prepareEmail(), but requires a Repo
Just pass in the required params and call either sendPreparedEmails or queuePreparedEmails.
Send will instantly send the email and archive it as sent. Queue will place it in the Repo queue
for later retrieval and sending. Once a queued email was sent, it is marked as such. For more info
and demos, please see the homepage and in-depth documentation (coming soon).
####Templates and demos Apart from the main site, there's a default MySQL/MariaDB Repo in the /fp subfolder. There's also an SQL script file there (and a workbench model), which you can use to build a MySQL/MariaDB Repo. Inject the Repo into the Mailer class and you have a working MySQL Mailer implementation ready for use in any project. Alternatively, use the Repo class to build your own, and inject that one. As long as it implements the MailRepository interface, it's all good. There will also be a PostreSQL demo Repo soon in the same folder, ready for production use. Note that the current demo repos extend the adapters from fp/common.
It is recommended you keep a separate schema for the email database as it will make backups and restorations much simpler.
####Requirements
- Php 5.4+
- Swift Mailer (add "swiftmailer/swiftmailer":"v4.3.0" (or higher) to your composer.json file's require block)
- IMAP extension for checking when you've last sent an email to a specific person
- flyingpiranhas/common
####Installation You can install the fpmailer library with composer. Just look for flyingpiranhas/mailer on packagist.org and add it to your composer.json file for a painless installation. You can also download a zip from github and just point a regular PSR autoloader at the folder, but composer is the preferred method since it allows us to easily update the library and fix bugs and loopholes people help us discover further down the road.
####License See LICENSE.md
####Contributing There's a lot of @todos in the code, so feel free to take a look and submit a pull request if you fix anything. Also, we desperately need tests written. There is only one rule: follow PSR-2 as much as possible. Use other classes as examples and keep the coding style consistent.
####Contact We're on Twitter and I am on Google plus or at my website.
flyingpiranhas/mailer 适用场景与选型建议
flyingpiranhas/mailer 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 24 次下载、GitHub Stars 达 1, 最近一次更新时间为 2013 年 01 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「framework」 「mailing」 「imap」 「wireframe」 「wireframework」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 flyingpiranhas/mailer 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 flyingpiranhas/mailer 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 flyingpiranhas/mailer 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Framework HLEB2 is the foundation of the web application. Provides ease of development and application performance.
PHP class to access an IMAP mailbox. Specifically uses the Laminas library and not the IMAP extension.
yii2 extension to read and process mails from IMAP and PHP
Mailing module for HiPanel
Powerful newsletter system for TYPO3
IMAP client for PHP without php-imap extension dependency
统计信息
- 总下载量: 24
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 19
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2013-01-23