Skip to content

v4 API: Support Adding Subscribers to Legacy Forms#674

Merged
n7studios merged 2 commits intov4-api-oauth-dynamic-redirect-urifrom
v4-api-oauth-add-subscriber-legacy-form
Jun 13, 2024
Merged

v4 API: Support Adding Subscribers to Legacy Forms#674
n7studios merged 2 commits intov4-api-oauth-dynamic-redirect-urifrom
v4-api-oauth-add-subscriber-legacy-form

Conversation

@n7studios
Copy link
Copy Markdown
Contributor

@n7studios n7studios commented Jun 11, 2024

Summary

Uses this PR and some logic to call the applicable v4 API method, depending on whether the Plugin needs to add the subscriber to a Form or Legacy Form.

Testing

  • testSettingsContactForm7ToConvertKitLegacyFormMapping: Test that Contact Form 7 to Legacy Form subscribing/mapping works
  • testSettingsForminatorFormToConvertKitLegacyFormMapping: Test that Forminator to Legacy Form subscribing/mapping works
  • testSettingsWishListMemberLevelToConvertKitLegacyFormMapping: Test that WishList Member to Legacy Form subscribing/mapping works

Checklist

@n7studios n7studios added this to the 2.5.0 milestone Jun 11, 2024
@n7studios n7studios self-assigned this Jun 11, 2024
@n7studios n7studios requested review from a team, corydhmiller and noelherrick and removed request for a team June 11, 2024 16:53
@n7studios n7studios marked this pull request as ready for review June 11, 2024 16:54
Copy link
Copy Markdown
Contributor

@noelherrick noelherrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with a bit of duplication, but perhaps we add a new method in the core library that subscribes to either a non-legacy or a legacy form? I think that could also reduce the number of tests you need to write since we can just test it in the library and then the consumers can just call it transparently.

@n7studios
Copy link
Copy Markdown
Contributor Author

I'm fine with a bit of duplication, but perhaps we add a new method in the core library that subscribes to either a non-legacy or a legacy form? I think that could also reduce the number of tests you need to write since we can just test it in the library and then the consumers can just call it transparently.

I considered this, however this would involve an additional API call. Forms are cached by each Plugin via a resource class, and the core library won't know which resource class to reference (e.g. ConvertKit_Resource_Forms, CKWC_Resource_Forms etc). The core library would need to look up whether the Form ID given is legacy or not before determining which API endpoint to call.

That aside, the concept of "subscribing" to a form / legacy form is from the v3 API, as there was no way to create a subscriber (unless subscribing to a tag or other resource). Now that the v4 API provides the ability to create a subscriber, I'd like to remove this concept of subscribing to a form in the Plugin (just not at the same time as migrating to the v4 API).

All calls made to form_subscribe (and legacy_form_subscribe) relate to our integrations with third party Form Plugins. Subscribing customers to a form in ConvertKit when they're filling out a form in WordPress confuses some customers, and is a concept we can move away from in the future, given the ability to directly create a subscriber.

As such, this code exists to ensure we don't introduce breaking changes, but will later be deprecated and then removed.

@n7studios n7studios merged commit d9d0f96 into v4-api-oauth-dynamic-redirect-uri Jun 13, 2024
@n7studios n7studios deleted the v4-api-oauth-add-subscriber-legacy-form branch June 26, 2024 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants