doowebdev/mailchimp-api 问题修复 & 功能扩展

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

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

doowebdev/mailchimp-api

最新稳定版本:1.4

Composer 安装命令:

composer require doowebdev/mailchimp-api

包简介

Doowebdev PHP MailChimp API v2 Wrapper using Guzzle

README 文档

README

An Easy to use PHP wrapper for the MailChimp API v2 using Guzzle

#Installation:

Requires: php 5.4+ and Guzzle (will be added automatically when you install this package).

To install the latest version of doowebdev/mailchimp-api simply add it to your composer.json file in the 'require section':

"doowebdev/mailchimp-api": "dev-master"

Next Run 'composer install' in your command console to add the package to your projects vendor folder.

Once the package is installed, you need to initialize the MailChimpApi class:

require 'vendor/autoload.php';

use Doowebdev\MailChimpApi;

How to use

Assuming you are using php classes in your application use the following as an example:

In a controller:

use Doowebdev\MailChimpApi;

class SomeClass
{

    public function someMethod()
    {
        $mc = new MailChimpApi('YOUR-MAILCHIMP-APIKEY-GOES-HERE');

       //We are using the 'lists/subscribe' method to subscribe a user/visitor to our newsletter list.
        $results = $mc->run('lists/subscribe',[
            'id'                => 'YOUR-LIST-ID-GOES-HERE',
            'email'             => ['email'=>'subscribers@email.com'],
            'merge_vars'        => ['FNAME'=>'subscribers_firstname', 'LNAME'=>'subscribers_lastname'],
            'double_optin'      => true,
            'update_existing'   => true,
            'replace_interests' => false,
            'send_welcome'      => true,
        ]);

        var_dump($results);
    }

}

Thats it!

To get the complete list of methods you can use visit the official MailChimp API documentation here: https://apidocs.mailchimp.com/api/2.0/#method-sections

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-02-26