Git Product home page Git Product logo

iterable-php-wrapper's Introduction

Iterable PHP Wrapper

Build Status Coverage Status

Getting Started

Clone the repository:

git clone https://github.com/cdlewis/iterable-php-wrapper.git

Include the wrapper:

require_once( 'iterable-php-wrapper/iterable.php' );

Instantiate the class with your API key:

$iterable = new Iterable( 'YOUR API KEY' );

Examples

Lists

Show all lists:

$iterable->lists();

Subscribe users to a list:

$iterable->list_subscribe( $list_id, array(
	array( 'email' => '[email protected]' ),
	array( 'email' => '[email protected]' )
);

Unsubscribe users from a list:

$iterable->list_unsubscribe( $list_id, array(
	array( 'email' => '[email protected]' ),
	array( 'email' => '[email protected]' )
) );

Events

Add an event to a user profile:

$iterable->event_track( '[email protected]', 'Test Event' );

Tie user event to a specific campaign

$iterable->event_track(
    '[email protected]',
    'test event',
    time(),
    array(
        'some data field' => 'some data field value'
    ),
    false,
    'some campaign id',
);

Users

Get a user by email:

$iterable->user( '[email protected]' );

Change a user's email:

$iterable->user_update_email( '[email protected]', '[email protected]' );

Delete a user:

$iterable->user_delete( '[email protected]' );

Get available fields for users:

$iterable->user_fields();

Update multiple users at once:

$iterable->user_bulk_update( array(
    array(
        'email' => '[email protected]',
        'dataFields' => array( 'name' => 'Jack' )
    ),
    array(
        'email' => '[email protected]',
        'dataFields' => array( 'name' => 'Jane' )
    )
) );

Update a user's subscriptions:

$iterable->user_update_subscriptions( '[email protected]' );

Update a user:

$iterable->user_update(
    '[email protected]',
    array( 'name' => 'Jack' )
);

Campaigns

Get all campaigns:

$iterable->campaigns();

Create a campaign:

$iterable->campaigns_create( 'My Campaign', 1600, 1601, false, '11:00 AM' );

Commerce

Add a purchase to a user:

$purchases = array(
    array(
        'id' => '1',
        'name' => 'widget',
        'price' => 10,
        'quantity' => 1
    ),
    array(
        'id' => '2',
        'name' => 'knob',
        'price' => 10,
        'quantity' => 1
    )
);
$iterable->commerce_track_purchase( '[email protected]', $purchases );

Update a user's cart:

$iterable->commerce_update_cart(
    array( 'email' => '[email protected]' ),
    array( array(
        'id' => '1',
        'name' => 'widget',
        'price' => 10,
        'quantity' =>1
    ) )
);

Send an email using a trigger campaign:

$iterable->email( 1600, '[email protected]' );

Export

Export as JSON:

$iterable->export_json( 'user', 'All' );

Export as CSV:

$iterable->export_csv( 'user', 'All' );

Workflows

Trigger workflow for email:

$iterable->trigger_workflow( '[email protected]', WORKFLOW_ID );

Trigger workflow for list (of emails):

$iterable->trigger_workflow( false, WORKFLOW_ID, false, LIST_ID );

iterable-php-wrapper's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.