Repository navigation
[SDK-867] Send the proof through a triggered campaign with proof-push --campaign - #45
Open
franco-zalamena-iterable wants to merge 2 commits into
Open
franco-zalamena-iterable wants to merge 2 commits into
franco-zalamena-iterable wants to merge 2 commits into
Conversation
die, count_prior_proof, finish and upserted_id come out of the template proof path so a second send mode can reuse them, and dash_host moves from bin/iterable-keys to config.sh so proof-push can build dashboard links. The template proof behaves exactly as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Campaign mode gives G17 a real pushSend to match. It refuses to touch Iterable without the campaign approval, picks a transactional push message type (and stops to ask when only a marketing one exists), and ends with a dashboard link and a resume command when the project blocks API activation. The campaign id is recorded as ITBL_PROOF_CAMPAIGN_ID the moment campaigns/create answers, so a resumed run looks that one campaign up instead of listing the project's campaigns, which paginate. The send targets recipientUserId or recipientEmail to match the identity, and only a successful send records ITBL_CAMPAIGN_ID, ITBL_PROOF_MARKER and ITBL_PROOF_SENT_AT. Archiving a running campaign aborts the push it has queued, so a campaign is never archived in the run that sends through it. The next --campaign run archives the previous campaign if a push went through it, but only after its own send, so a run whose new campaign cannot be activated leaves the old one running. A campaign Iterable does not list under success stays recorded in ITBL_PROOF_CAMPAIGN_STALE and is tried again next run. A recorded campaign this project does not have, as after a project switch, gets one line naming it. --keep-campaign reuses the campaign instead. A 2xx body that is not JSON stops the run with a clear error. --message-type now applies to an existing base template too, and itbl_err shows an error's message field. A template proof clears ITBL_CAMPAIGN_ID only when campaign mode set it, and warns when one is left for G17 to gate on. Bumps the manifests to 26.11.5. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
SDK-867
This PR adds
proof-push --campaign, which sends the proof push through a triggered campaign in the developer's Iterable project so G17 has a real pushSend to match. It needs theagent approve campaignconsent from #44, and without it the run stops before making any call to Iterable.It picks a transactional push message type, since frequency caps, quiet hours and opt-outs on a marketing type can turn the proof into a pushSendSkip. If the project only has a marketing type the run stops with nothing created and asks the developer, and
--message-type <id>opts in to that type. If the project doesn't let the API activate triggered campaigns, the run ends with the campaign's dashboard link and aproof-push --campaigncommand that resumes with the same campaign instead of creating another. The send usesrecipientUserIdfor user ID identities andrecipientEmailotherwise.Only a successful send records
ITBL_CAMPAIGN_IDfor G17 andITBL_PROOF_MARKERandITBL_PROOF_SENT_ATfor G16 and G17, the marker is carried in the push itself. A plainproof-pushafterwards clearsITBL_CAMPAIGN_IDonly if campaign mode set it, and warns when one set by the developer is left for G17 to gate on.The proof campaign is never archived in the run that sends through it, because archiving a Running triggered campaign makes Iterable skip the queued send. The previous proof campaign is archived by the next
--campaignrun, and only after that run's own send succeeds, so a run that fails before sending leaves the last working campaign running. A failed archive is kept inITBL_PROOF_CAMPAIGN_STALEand retried on the next run.--keep-campaignreuses the campaign and archives nothing.The first commit, "Pull the proof send's shared steps into helpers", is a behaviour-neutral refactor of the template proof so campaign mode can reuse it, and it can be reviewed on its own.
This is the third part of SDK-867, after #43 (G17 matching) and #44 (campaign consent). It is stacked on #44 and will be retargeted to main after #44 merges. Plugin version is bumped to 26.11.5.
Type
If this is a skill / pipeline / CI change
pnpm check:allgreen (not run locally, nothing underpipeline/changed and the manifests are covered bytests/plugin-manifests.shbelow)SKILL.md, sanity-checked the routing table against that skill'sreference/(n/a)Testing
tests/campaign-push.shis new. It stubs curl and covers the consent check, the message type choice, activation disabled and resume, therecipientUserIdtarget, what gets recorded for G16 and G17, the archive order and retries,--keep-campaign, and a 2xx with an HTML body on every call.The last full
bash tests/run-all.sh, before the final small fix, gave 51 suites ok and 0 failed. The new endpoint checks intests/key-types-match-spec.shwere not run, since that suite needs the network.Anything reviewers should know
Each run that creates a campaign also leaves a cloned template behind, and those accumulate until teardown cleans them up, which comes in a later PR. This hasn't been run against a live Iterable project yet, a live proof send is planned before release.
🤖 Generated with Claude Code