定制 php-monsters/laravel-postal-driver 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

php-monsters/laravel-postal-driver

Composer 安装命令:

composer require php-monsters/laravel-postal-driver

包简介

Laravel mail transport driver for Postal API

README 文档

README

A custom Laravel mail transport driver to send emails via the Postal mail server using its HTTP API instead of SMTP. Official documentation: https://apiv1.postalserver.io/controllers/send/message.html

📦 Features

  • Send transactional emails via Postal HTTP API
  • Uses Laravel's native Mail::to()->send() interface
  • Clean, framework-native mail transport driver
  • Compatible with Laravel version 8.0+

🚀 Installation

Step 1: Require the package (from local path or Git)

If using local development:

composer require php-monsters/laravel-postal-driver

Or add to your composer.json:

"repositories": [
  {
    "type": "path",
    "url": "./packages/PhpMonsters/LaravelPostalDriver"
  }
],
"require": {
  "php-monsters/laravel-postal-driver": "*"
}

Then run:

composer update

⚙️ Configuration

Step 2: Set up .env variables

MAIL_DRIVER=postal
POSTAL_API_KEY=your_postal_api_key_here
POSTAL_API_ENDPOINT=https://postal.yourdomain.com

Step 3: Configure config/mail.php

Add to the mailers array:

'mailers' => [
    'postal' => [
        'transport' => 'postal',
        'key' => env('POSTAL_API_KEY'),
        'endpoint' => env('POSTAL_API_ENDPOINT'),
    ],
],

✉️ Usage

Use Laravel's standard Mail facade:

use App\Mail\TestMail;
use Illuminate\Support\Facades\Mail;

Mail::to('recipient@example.com')->send(new TestMail());

Your Mailable class should work as usual.

📐 Under the Hood

This driver makes HTTP POST requests to:

POST /api/v1/send/message

With headers:

X-Server-API-Key: {your_api_key}
Content-Type: application/json

Payload:

{
  "to": "recipient@example.com",
  "from": "you@yourdomain.com",
  "subject": "Subject Line",
  "plain_body": "Text version",
  "html_body": "<p>HTML version</p>"
}

🛠 Requirements

  • Laravel 8 or newer
  • Postal mail server with API access
  • PHP 8.0+
  • Guzzle 7+

📝 License

This project is open-sourced under the MIT license.

🤝 Credits

Made with ❤️ by Aboozar Ghaffari

Postal by Atech Media

php-monsters/laravel-postal-driver 适用场景与选型建议

php-monsters/laravel-postal-driver 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 8 次下载、GitHub Stars 达 2, 最近一次更新时间为 2025 年 07 月 05 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 php-monsters/laravel-postal-driver 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 php-monsters/laravel-postal-driver 我们能提供哪些服务?
定制开发 / 二次开发

基于 php-monsters/laravel-postal-driver 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 8
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 13
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2025-07-05