From f2b0b3890c783ea987b269cbfbd0a1e8c1db7884 Mon Sep 17 00:00:00 2001 From: Thomas Barrett Date: Wed, 9 Feb 2022 16:35:02 +0000 Subject: [PATCH 1/4] Add funcion to get contact's custom field values. Add function to add contact to automation. --- src/contacts/Contacts.php | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/contacts/Contacts.php b/src/contacts/Contacts.php index 169ffb8..bbad9c0 100644 --- a/src/contacts/Contacts.php +++ b/src/contacts/Contacts.php @@ -141,6 +141,44 @@ public function listAutomations(int $id) return $req->getBody()->getContents(); } + /** + * Add contact to automation + * @see https://developers.activecampaign.com/reference#create-new-contactautomation + * + * @param int $contact_id + * @param int $automation_id + * @return string + */ + public function addToAutomation( int $contact_id, int $automation_id ){ + $req = $this->client + ->getClient() + ->post( '/api/3/contactAutomations', [ + 'json' => [ + 'contactAutomation' => [ + 'contact' => $contact_id, + 'automation' => $automation_id + ] + ] + ]); + return $req->getBody()->getContents(); + } + + /** + * Get contact custsom field values + * @see https://developers.activecampaign.com/reference#retrieve-contact-field-values + * + * @param int $contact_id + * @return string + */ + public function getCustomFieldValues( int $contact_id ){ + $req = $this->client + ->getClient() + ->get( '/api/3/contacts/' . $contact_id . '/fieldValues' ); + + return $req->getBody()->getContents(); + } + + /** * Add a tag to contact * @see https://developers.activecampaign.com/reference#create-contact-tag From e404718a8346fe41c3dd79424be330a41c46a4b5 Mon Sep 17 00:00:00 2001 From: Thomas Barrett Date: Tue, 8 Mar 2022 10:57:10 +0000 Subject: [PATCH 2/4] Author update --- composer.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index cb129f4..4e37f13 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { - "name": "mediatoolkit/activecampaign-v3-php", - "description": "PHP Wrapper for ActiveCampaign", + "name": "adrennialbarrett/activecampaign-v3-php", + "description": "PHP Wrapper for ActiveCampaign (forked from mediatoolkit)", "require": { "guzzlehttp/guzzle": "~6.3" }, @@ -12,6 +12,10 @@ { "name": "Mediatoolkit", "email": "info@mediatoolkit.com" + }, + { + "name": "TB", + "email": "thomas.barrett@adrennial.global" } ], "autoload": { From f5537a6a95d58540ce214e90c2937ec073766a25 Mon Sep 17 00:00:00 2001 From: Thomas Barrett Date: Tue, 8 Mar 2022 11:03:12 +0000 Subject: [PATCH 3/4] Add repo type --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 4e37f13..8b48e24 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,6 @@ { "name": "adrennialbarrett/activecampaign-v3-php", + "type": "library", "description": "PHP Wrapper for ActiveCampaign (forked from mediatoolkit)", "require": { "guzzlehttp/guzzle": "~6.3" From d51b3ad103d2c33be8f533bdd85406e75474defa Mon Sep 17 00:00:00 2001 From: Thomas Barrett Date: Tue, 8 Mar 2022 11:06:59 +0000 Subject: [PATCH 4/4] Casing change test --- src/{lists => Lists}/Lists.php | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/{lists => Lists}/Lists.php (100%) diff --git a/src/lists/Lists.php b/src/Lists/Lists.php similarity index 100% rename from src/lists/Lists.php rename to src/Lists/Lists.php