plasma-platform/esputnik 问题修复 & 功能扩展

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

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

plasma-platform/esputnik

最新稳定版本:0.2.0

Composer 安装命令:

composer require plasma-platform/esputnik

包简介

Marketing automation system ESputnik.

README 文档

README

Latest Stable Version Total Downloads Latest Unstable Version License

Marketing automation system ESputnik.

curl

A basic CURL wrapper for PHP (see http://php.net/curl for more information about the libcurl extension for PHP)

Requirements

  • PHP >= 5.4
  • EXT-CURL = *

Installation

Add a line to your "require" section in your composer configuration:

{
    "require": {
        "ossbrownie/esputnik": "0.1.3"
    }
}

Usage

$eSputnik = new ESputnik(
    new HTTPClient(
        new CurlClient(),
        new Config([
            'login' => 'tester',
            'password' => 'passwd'
        ])
    )
);

{
    $version = $eSputnik->version();
}

{
    $contact = new Contact();

    $contact
        ->setFirstName('FName')
        ->setLastName('LName')
        ->setContactKey('contact@site.com');

    $channelList = new ChannelList();
    $channelList->add(new EmailChannel([
        'value' => 'tester@site.com'
    ]));

    $fieldList = new FieldList();
    $fieldList
        ->add(new Field([
            'id' => 12345,
            'value' => 'CustomValue1',
        ]))
        ->add(new Field([
            'id' => 12346,
            'value' => 'CustomValue2',
        ]));

    $contact
        ->setFieldList($fieldList);

    $contact
        ->setChannelList($channelList);

    $subscribe = new Subscribe();
    $subscribe
        ->setFormType('test_type')
        ->getGroups()->add(new Group([
            'name' => 'Test group'
        ]));

    $response = $eSputnik->contactSubscribe($contact, $subscribe);
}

{
    $addressbooks = $eSputnik->addressbooks();
}

{
    $groups = $eSputnik->groups();
}

{
    $params = new ParamList();
    $params
        ->add(new Parameter([
            'name' => 'EmailAddress',
            'value' => 'tester@site.com',
        ]));

    $eSputnik->event(new Event([
        'eventTypeKey' => 'test-test',
        'keyValue' => 'test-' . time(),
        'params' => $params
    ]))
}

Tests

To run the test suite, you need install the dependencies via composer, then run PHPUnit.

$> composer.phar install
$> ./vendor/bin/phpunit --colors=always --bootstrap ./tests/bootstrap.php ./tests

License

HttpClient is licensed under the MIT License

Contact

Problems, comments, and suggestions all welcome: oss.brownie@gmail.com

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-10-10