STRATCONN-6540 - [Iterable] - new subscription management Action#3815
Open
joe-ayoub-segment wants to merge 5 commits into
Open
STRATCONN-6540 - [Iterable] - new subscription management Action#3815joe-ayoub-segment wants to merge 5 commits into
joe-ayoub-segment wants to merge 5 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new Iterable destination action (updateSubscriptions) to manage user subscription preferences (subscribe/unsubscribe) across channels, message types, and email lists. The action supports single-event updates via per-user endpoints and batched updates via bulk endpoints, and includes dynamic dropdowns for selecting subscription group IDs.
Changes:
- Introduces
updateSubscriptionsaction with identifier resolution (email vs userId) and max-items validation. - Implements dynamic fields to fetch Channels / Message Types / Lists from Iterable for dropdown population.
- Adds unit tests covering single-event behavior, batching behavior, validation errors, and EU data center routing.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/destination-actions/src/destinations/iterable/utils.ts | Adds Iterable API endpoints used by dynamic dropdown fetches (channels, message types, lists). |
| packages/destination-actions/src/destinations/iterable/updateSubscriptions/types.ts | Defines response/data shapes for dynamic dropdowns and resolved identifier type. |
| packages/destination-actions/src/destinations/iterable/updateSubscriptions/index.ts | Implements the action definition, dynamic field wiring, single-event perform, and batched performBatch with MultiStatusResponse handling. |
| packages/destination-actions/src/destinations/iterable/updateSubscriptions/generated-types.ts | Generated payload types for the new action. |
| packages/destination-actions/src/destinations/iterable/updateSubscriptions/functions.ts | Adds identifier resolution and endpoint construction helpers for subscription APIs. |
| packages/destination-actions/src/destinations/iterable/updateSubscriptions/dynamic-fields.ts | Implements API calls to fetch channels/message types/lists for dynamic dropdowns. |
| packages/destination-actions/src/destinations/iterable/updateSubscriptions/constants.ts | Introduces MAX_SUBSCRIPTION_ITEMS. |
| packages/destination-actions/src/destinations/iterable/updateSubscriptions/tests/index.test.ts | Adds unit tests for single and batch flows, validation, and EU routing. |
| packages/destination-actions/src/destinations/iterable/index.ts | Registers the new updateSubscriptions action in the Iterable destination. |
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.
Testing
Unit Tests
perform (single event):
performBatch:
11. Subscribes multiple users via bulk PUT endpoint
12. Unsubscribes multiple users via bulk PUT endpoint
13. Handles multiple subscription items for batch
14. Separates users by email and userId in batch request body
15. Returns error in MultiStatusResponse for payloads missing identifiers
16. Marks all payloads as failed when API call fails
Staging Testing
[] Verify dynamic dropdown for subscription_group_id loads channels/message types/lists correctly based on group
type selection
[] Single event: subscribe to a channel, confirm user state in Iterable
[] Single event: unsubscribe from a message type, confirm user state
[] Batch: send multiple events, confirm bulk subscription applied
[] Mixed identifiers in batch: email-based and userId-based users in same batch
[] Confirm action field works when mapped from a payload property (e.g., $.properties.consent_action)
[] EU data center: verify requests route to api.eu.iterable.com
Security Review
Please ensure sensitive data is properly protected in your integration.
type: 'password'New Destination Checklist
verioning-info.tsfile. example