generationtux/marketo-rest-api-client

v0.0.5 2016-11-22 21:18 UTC

This package is not auto-updated.

Last update: 2024-09-10 22:14:09 UTC


README

Build Status

安装

composer require generationtux/marketo-rest-api-client

用法

实例化

$client = new Client([
    'api_url' => 'foo.bar/api',
    'client_id' => 'foobarid',
    'client_secret' => 'foobarsecret'
]);

创建潜在客户

点击 此处 查找所有有效的潜在客户字段。

$client->leads()->create([
    [
      'firstName' => 'Joe',
      'lastName'  => 'Bar',
      'email'     => 'foolead1@bar.com'
    ],
    [
      'firstName' => 'Sally',
      'lastName'  => 'Bar',
      'email'     => 'foolead2@bar.com'
    ]
]);

获取潜在客户

$lead = $client->leads()->show('fooemail@bar.com'); // outputs an object with all valid information on the lead

$lead->email; // outputs 'fooemail@bar.com'

触发活动

要触发活动,提供活动 ID、将接收活动电子邮件的潜在客户的电子邮件地址以及属于该活动的模板电子邮件的令牌(变量)数组

$client-campaign()
    ->trigger(1234, 'foobar@email.com',
        [
            '{{my.name}}' => 'Foo'
        ]
    );