From a663ad617d2c509e54ba5d171414cea35e96e25e Mon Sep 17 00:00:00 2001 From: Nikolaj Stockholm Date: Tue, 14 Jan 2020 15:51:14 +0100 Subject: [PATCH] New method for triggering automation for Contacts --- src/contacts/Contacts.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/contacts/Contacts.php b/src/contacts/Contacts.php index 169ffb8..6559460 100644 --- a/src/contacts/Contacts.php +++ b/src/contacts/Contacts.php @@ -141,6 +141,21 @@ public function listAutomations(int $id) return $req->getBody()->getContents(); } + public function triggerAutomation(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(); + } + /** * Add a tag to contact * @see https://developers.activecampaign.com/reference#create-contact-tag