lorddashme/php-mailchimp 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

lorddashme/php-mailchimp

Composer 安装命令:

composer require lorddashme/php-mailchimp

包简介

A PHP package wrapper for MailChimp API.

README 文档

README

A PHP package wrapper for MailChimp API.

This package support only the version 3 of Mailchimp API.

Latest Stable Version Minimum PHP Version Coverage Status

Requirement(s)

  • PHP version from 5.6.* up to latest.

Install

  • It is advice to install the package via Composer. Use the command below to install the package:
composer require lorddashme/php-mailchimp

Usage

  • Below are the available functions:
Function Description
post('route', closure/array); To request in the MailChimp API service using POST method. The body parameter accepts Cloure or Array type.
get('route'); To request in the MailChimp API service using GET method.
patch('route', closure/array); To request in the MailChimp API service using PATCH method. The body parameter accepts Cloure or Array type.
delete('route'); To request in the MailChimp API service using DELETE method.
action('route'); To request in the MailChimp API service using the custom ACTION.
getRequest(); To check the current request details. Can be use for debugging purposes.
getRespose(); To get the current response from the MailChimp API service.
Response Format:
{"response_body": {...}", "header": {"response_http_code": ...}}
  • Basic usage:
<?php

include __DIR__  . '/vendor/autoload.php';

use LordDashMe\MailChimp\MailChimp;

$apiKey = 'abcde12345...';

$mailchimp = new MailChimp($apiKey);

$listId = 'qwerty12345...';

$mailchimp->post("list/{$listId}/members", function ($requestBody) {
    $requestBody->email_address = 'sample_email@mailchimp.com';
    return $requestBody;
});

// If you want to investigate the current request details.
$mailchimp->getRequest();

// To get the response from the MailChimp API service.
// Response: {"response_body": {...}", "header": {"response_http_code": ...}}
$response = $mailchimp->getResponse();
  • Also can be done by using the below code:
<?php

include __DIR__  . '/vendor/autoload.php';

use LordDashMe\MailChimp\Facade\MailChimp;

$apiKey = 'abcde12345...';

MailChimp::init($apiKey);

$listId = 'qwerty12345...';

MailChimp::post("list/{$listId}/members", array(
    'email_address' => 'sample_email@mailchimp.com'
));

MailChimp::getRequest();

// Response: {"response_body": {...}", "header": {"response_http_code": ...}}
$response = MailChimp::getResponse();

License

This package is open-sourced software licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-08-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固