mvdnbrk/postmark-inbound
Composer 安装命令:
composer require mvdnbrk/postmark-inbound
包简介
API to process Postmark Inbound Webhooks.
README 文档
README
postmark-inbound
Simple API to process Postmark Inbound Webhooks.
Installation
You can install the package via composer:
composer require mvdnbrk/postmark-inbound
Usage
$inbound = new \Mvdnbrk\Postmark\InboundMessage(file_get_contents('php://input')); $inbound->from->name; // John Doe $inbound->from->email; // john@example.com $inbound->from->full; // John Doe <john@example.com> $inbound->tag; $inbound->replyTo; $inbound->textBody; $inbound->htmlBody; $inbound->messageId; // MessageID assigned by Postmark. $inbound->messageIdFromHeaders; // Message-ID value from headers. $inbound->strippedTextReply; $inbound->originalRecipient; $inbound->originalDate; // Wed, 6 Sep 2017 12:00:00 +0200 $inbound->date; // PostmarkDate::class which is an extension of the DateTime::class $inbound->date->format('Y-m-d H:i:s') // 2017-09-06 12:00:00 $inbound->date->isUtc // boolean, is the date in the UTC timezone? $inbound->date->timezone; // +02:00 $inbound->date->inUtcTimezone() // Sets the timezone to UTC. $inbound->subject; // Subject of the message. $inbound->isSpam; // boolean, is the message to be considered as spam? $inbound->spamStatus; // Spam status, defaults to 'No' when not present. $inbound->spamScore; // float, defaults to 0.0 when not present. $inbound->to->count() // Recipient count. $inbound->cc->count() $inbound->bcc->count() $inbound->attachments->count() // Attachment count. $inbound->headers->count() // Header count.
Recipients
$inbound->to->each(function($contact) { $contact->name; $contact->email; $contact->full; $contact->mailboxHash; }); $inbound->cc->each(function($contact) { $contact->name; ... }); $inbound->bcc->each(function($contact) { $contact->name; ... });
Get the first recipient:
$inbound->to->first();
Attachments
$inbound->attachments->each(function($attachment) { $attachment->name; $attachment->contentType; $attachment->contentLength; $attachment->content(); // Base64 decoded data });
Get the first attachment:
$inbound->attachments->first();
Get the last attachment:
$inbound->attachments->last();
Headers
The Message-ID in the headers are sometimes keyed with upper ID and sometimes they are in the format of Id.
So if you want to get the Message-ID from a message you can simply use the $inbound->messageIdFromHeaders helper attribute.
Please note that $inbound->messageId will give you the id of the message that was assigned by Postmark.
$inbound->headers->each(function($value, $key) { ... }); $inbound->headers->get('Message-ID'); $inbound->headers->get('MIME-Version'); $inbound->headers->get('Received-SPF'); $inbound->headers->get('X-Spam-Score'); $inbound->headers->get('X-Spam-Status'); ...
Change log
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
mvdnbrk/postmark-inbound 适用场景与选型建议
mvdnbrk/postmark-inbound 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.83k 次下载、GitHub Stars 达 8, 最近一次更新时间为 2017 年 11 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「postmark」 「inbound」 「webhook」 「e-mail」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mvdnbrk/postmark-inbound 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mvdnbrk/postmark-inbound 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mvdnbrk/postmark-inbound 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Library to send email across all platforms using one interface.
Convenience library for postmark inbound email parsing.
Provides an email provider for postmarkapp.com
A minor update of Miguel Perez's no-longer maintained code from https://github.com/miguel250/PostmarkBundle to allow for Symfony 3 compatibility. All credit/kudos/thanks for the work should obviously go to him
Inbound emails for Symfony apps with Sendgrid and Mailjet support
Inbox pattern process implementation for your Laravel Applications
统计信息
- 总下载量: 1.83k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 2
其他信息
- 授权协议: MIT
- 更新时间: 2017-11-07