klaviyo / php-klaviyo

PHP wrapper for the Klaviyo API
59 stars 48 forks source link

add API call for excluding profile from all email #62

Closed bradleymellen closed 3 years ago

bradleymellen commented 3 years ago

This API call is documented under "Lists & Segments" (https://apidocs.klaviyo.com/reference/lists-segments#exclude-globally) but is actually part of the "people" endpoint, so I wasn't sure where to put it; for now I decided it made more sense to put it in Profiles.php but I don't feel strongly one way or the other. I also had to make some modifications to v1 request handling in KlaviyoAPI.php due to the way this particular API call apparently wants its requests formatted; I tried to be as minimal as possible with my tweaks but I'm open to critique on the approach.

smoucka commented 3 years ago

Hi @bradleymellen thanks for adding this endpoint. I noticed that this request requires a new code path for authentication and after looking at the reason why I'm going to fix this underlying issue. It should make your contribution much more streamlined as a result and not require changes to the KlaviyoAPI class. I'll let you know when that's merged in and you can update your PR accordingly.

bradleymellen commented 3 years ago

@smoucka - Thanks for the review and the cleanup in KlaviyoAPI.php. I've rebased my pull request against master and addressed your comments.