Repository navigation
feat: active campaign integration - #29
Merged
Merged
Conversation
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds ActiveCampaign as a fifth first-party mailing list driver. Entries sync to an ActiveCampaign list on sign-up with the same config surface as the existing drivers — no new API on the package side.
ActiveCampaign's v3 API addresses everything by id — lists, tags and custom fields — so most of the driver is resolving names to ids before a call can be made.
Things to note worth attention:
contact/syncmatches on email, so a returning sign-up updates the existing contact instead of erroring on a duplicate. List membership is a separate resource (/contactLists), so subscribe is two calls: sync the contact, then place them on the list with status1. That status also re-activates somebody who had previously unsubscribed from this list, which is the right reading of them signing up again./fieldsby title or perstag. An attribute with no matching field on the account is skipped — a rejected contact costs the sign-up, a missing annotation does not.Unsubscribe sets the list membership to status
2rather than deleting the contact: the unsubscribe is a fact about this list, and a delete would remove them from every other list on the account too.Errors are unwrapped from ActiveCampaign's
errors[].titlearray into theMailingListExceptionmessage, so a failure says what was actually refused instead ofArray to string conversion.Configuration takes the account URL exactly as ActiveCampaign shows it under Settings → Developer;
/api/3is appended by the driver.Type of change
No breaking changes — the driver is additive and inert until waitlist.mailing_list.default (or an explicit MailingList::driver() call) selects activecampaign. No new package dependencies; the driver uses Laravel's HTTP client.
How Has This Been Tested?
Nine Pest feature tests in tests/Feature/ActiveCampaignTest.php, all driving the real sign-up path (Waitlist::add()) against a faked HTTP client rather than calling the driver directly:
back onto the entry
To reproduce:
vendor/bin/pest tests/Feature/ActiveCampaignTest.php
composer test && composer analyse && vendor/bin/pint --test
Test Configuration:
Not exercised against a live ActiveCampaign account — all HTTP is faked. A reviewer with a sandbox account confirming a real round-trip would be worth having before release.
Checklist