Giter Club home page Giter Club logo

convertkitsdk-php's Introduction

ConvertKit SDK PHP

ConvertKit's official PHP SDK

Installation

  1. Download or clone this repository
  2. Run composer install
  3. Add ./vendor/auoload.php to your project

Usage

Get your ConvertKit API Key and API Secret here and set it somewhere in your application.

$api = new \ConvertKit_API\ConvertKit_API($api_key, $api_secret);

Examples

Subscribe to a form

Add a subscriber to a form. The $subscribed response will be an object.

$tag_id = '99999'; // This tag must be valid for your ConvertKit account.

$options = [
			'email'      => '[email protected]',
			'name'       => 'Full Name',
			'first_name' => 'First Name',
			'tags'       => $tag_id,
			'fields'     => [
				'phone' => 134567891243,
				'shirt_size' => 'M',
				'website_url' => 'testurl.com'
			]
		];

$subscribed = $api->form_subscribe($this->test_form_id, $options);

Get Subscriber ID

Get the ConvertKit Subscriber ID for a given email address.

$subscriber_id = $api->get_subscriber_id( $email );

Get Subscriber

Get subscriber data for a ConvertKit Subscriber.

$subscriber = $api->get_subscriber( $subscriber_id );

Get Subscriber Tags

Get all tags applied to a Subscriber.

$subscriber_tags = $api->get_subscriber_tags( $subscriber_id );

Add Tag to a Subscriber

Apply a tag to a Subscriber.

$tag_id = '99999'; // This tag must be valid for your ConvertKit account.
$api->add_tag(tag_id, [
			'email' => '[email protected]'
		]);

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.