Skip to content

STRATCONN-6540 - [Iterable] - new subscription management Action#3815

Open
joe-ayoub-segment wants to merge 5 commits into
mainfrom
iterable-subscription-management
Open

STRATCONN-6540 - [Iterable] - new subscription management Action#3815
joe-ayoub-segment wants to merge 5 commits into
mainfrom
iterable-subscription-management

Conversation

@joe-ayoub-segment

Copy link
Copy Markdown
Contributor
  • Adds a new updateSubscriptions action to the Iterable destination that allows users to subscribe/unsubscribe from channels, message types, and email lists
  • Uses additive PATCH/DELETE endpoints for single events (/api/subscriptions/{group}/{id}/user/{email})
  • Uses bulk PUT endpoint for batches (/api/subscriptions/{group}/{id}?action=subscribe|unsubscribe)
  • Dynamic dropdown for subscription group ID fetches available channels, message types, or lists from Iterable's API based on group type selection
  • Supports configurable user identifier preference (email vs userId) with fallback logic
  • Returns MultiStatusResponse for batch partial failures

Testing

Unit Tests

perform (single event):

  1. Subscribes a user by email using PATCH
  2. Subscribes a user by userId using PATCH
  3. Unsubscribes a user by email using DELETE
  4. Handles multiple subscription items in one event
  5. Prefers email when preference is email and both are provided
  6. Prefers userId when preference is userId and both are provided
  7. Falls back to userId when preference is email but email is missing
  8. Throws PayloadValidationError when both identifiers missing
  9. Throws PayloadValidationError when more than 6 subscription items
  10. Uses Europe endpoint when data center is configured

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.

  • Reviewed all field definitions for sensitive data (API keys, tokens, passwords, client secrets) and confirmed they use type: 'password'

New Destination Checklist

  • Extracted all action API versions to verioning-info.ts file. example

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 updateSubscriptions action 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.

Copilot AI review requested due to automatic review settings May 26, 2026 14:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.

Copilot AI review requested due to automatic review settings May 26, 2026 14:28
@joe-ayoub-segment joe-ayoub-segment marked this pull request as ready for review May 26, 2026 14:29
@joe-ayoub-segment joe-ayoub-segment requested a review from a team as a code owner May 26, 2026 14:29
@joe-ayoub-segment joe-ayoub-segment added the needs-stage-test Must be tested in Stage before deployment label May 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Comment thread packages/destination-actions/src/destinations/iterable/utils.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-stage-test Must be tested in Stage before deployment partner-eng-review (cloud)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants