鸽子/鸽子

Pigeon 允许您轻松管理您的出站电子邮件、推送通知和短信。访问 https://pigeonapp.io 获取更多信息。

v0.2.0 2019-03-31 18:22 UTC

This package is not auto-updated.

Last update: 2024-09-30 20:57:06 UTC


README

Pigeon 允许您轻松管理您的出站电子邮件、推送通知和短信。访问 https://pigeonapp.io 获取更多信息。

安装

推荐通过 Composer 安装 Pigeon。

$ composer require pigeon/pigeon

使用

$pigeon = new Pigeon\Client('PIGEON_PUBLIC_KEY', 'PIGEON_PRIVATE_KEY');

如果没有传递,公共 (PIGEON_PUBLIC_KEY) 和私有 (PIGEON_PRIVATE_KEY) 密钥将从环境变量中检索。

准备发送

$message_identifier = 'message-identifier';
$parcels = ['to' => 'john@example.com'];
  • 消息标识符用于识别消息。从您的 Pigeon 控制面板获取此信息。
  • 包裹数组接受 toccbccdata

发送

$pigeon->deliver($message_identifier, $parcels);

包裹示例(单个接收者)

$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'
    ]
  ]
];

包裹示例(多个接收者)

$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'
    ]
  ],
];

框架集成

贡献

您可以通过以下两种方式之一进行贡献

  1. 使用 问题跟踪器 提交错误报告。
  2. 问题跟踪器 上回答问题或修复错误。

该项目旨在成为一个安全、欢迎的协作空间,并且期望贡献者遵守 贡献者守则

许可证

Composer 包根据 MIT 许可证 的条款提供为开源。

行为准则

所有与 Pigeon 项目代码库、问题跟踪器、聊天室和邮件列表互动的人都有期望遵守 行为准则