定制 eldadfux/mailgun-lite 二次开发

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

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

eldadfux/mailgun-lite

最新稳定版本:v1.5.0

Composer 安装命令:

composer create-project eldadfux/mailgun-lite

包简介

A lite and minimalistic PHP client library for sending mails using Mailgun API.

README 文档

README

Mailgun PHP Lite is a lite and minimalistic PHP client library for sending mails using Mailgun API with no external dependencies. This library was created to provide a very simple curl abstraction for sending mails using the Mailgun HTTP API. This is an alternative to those who need to just send simple mails and think the original PHP Client is to heavy for them and have a to much dependencies.

Installation

composer require 'eldadfux/mailgun-lite:1.3.*'

Example

$apiKey    = 'your-api-key-here';
$apiDomain = 'your-api-sending-domain-here';

$mailgun = new \MailgunLite\MailgunLite($apiKey, $apiDomain);

$mailgun
    ->setFrom('team@example.com', 'Team Example')
    ->setReplyTo('this@gmail.com') // (optional)
    ->setSchedule(strtotime('next Thursday')) // unix time stamp (optional)
    ->addRecipient('user1@example.com', 'User 1 Name')
    ->addRecipient('user2@example.com', 'User 2 Name')
    ->addRecipient('user3@example.com', 'User 3 Name')
    ->setSubject('Hello World')
    ->setText('I am a string')
    ->setHTML('<b>I am a string</b>')
;

// Send Mail
if(!$mailgun->send()) {
    throw new Exception('Problem sending mail: ' . $mailgun->getError());
}

// Subscribe to newsletter
$mailgun->subscribe('newsletter@example.com', 'user1@example.com');

Contributing

All code contributions - including those of people having commit access - must go through a pull request and approved by a core developer before being merged. This is to ensure proper review of all the code.

Fork the project, create a feature branch, and send us a pull request.

Versioning

For transparency and insight into our release cycle, and for striving to maintain backward compatibility, This project will be maintained under the Semantic Versioning guidelines as much as possible. Releases will be numbered with the following format:

<major>.<minor>.<patch>

For more information on SemVer, please visit http://semver.org/.

Requirements

PHP 7+

We recommend using the latest PHP version whenever possible.

Author

Eldad A. Fux

License

This project is licensed under the MIT License - see the LICENSE file for details

统计信息

  • 总下载量: 4.07k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-12-21