bcismariu/greenarrow-php

GreenArrow 发送邮件 API 的简单 PHP 包装器

v0.0.1 2017-01-19 15:57 UTC

This package is auto-updated.

Last update: 2024-09-13 05:53:23 UTC


README

Build Status Latest Stable Version License Total Downloads

安装

更新你的 composer.json 文件

{
    "require": {
        "bcismariu/greenarrow-php": "0.*"
    }
}

运行 composer update

使用

use Bcismariu\GreenArrow\GreenArrow;
use GuzzleHttp\Client;
use Http\Adapter\Guzzle6\Client as GuzzleAdapter;

$mailer = new GreenArrow(new GuzzleAdapter(new Client()), [
    'username'      => 'username',
    'password'      => 'password',
]);

$mailer->send([
    'message'   => [
        'to' => [[
            'name'  => 'John Smith',
            'email' => 'john.smith@example.com'
        ]],
        'from_name'     => 'Jane Doe',
        'from_email'    => 'jane.doe@example.com',
        'subject'       => 'A simple subject',
        'html'          => '<h1>A simple html body</h1>',
    ],
]);

贡献

这是一个非常基础的实现,只能处理基本调用。欢迎任何项目的贡献!