Broadcasts
A project's broadcasts as a connector's creator surface sizes and sends them — the audiences with their sizes, a draft previewed before it is sent, and the send that posts once where a connector announces and per member everywhere else.
Subscriby\Connector\Core\Broadcasts. A broadcast is one message to a segment of the project's members, delivered by the core through every live installation: posted once where a connector announces (the Announcer port) and sent per member everywhere else, at the pace each platform allows. The connector only asks and confirms. Every call takes the CreatorRef of the account talking and runs as that creator, and every refusal reaches you as BroadcastRefused with a stable reason.
audiences()
foreach ($this->broadcasts->audiences($creator, $project) as $audience) {
// $audience->value, ->label, ->count, ->acceptsPlan, ->requiresPassWindow, ->requiresHorizon
}Every audience the project may address, each a BroadcastAudienceOption with its value (what a draft takes), its label in the core's words, how many members it reaches now, whether a plan may narrow it, whether it needs a pass window to be sized or sent, and whether it looks a number of days ahead. Audiences that need the passes capability are left out for a creator whose plan lacks it.
preview() and send()
$draft = new BroadcastDraft('<b>Doors open</b> at eight tonight.', audience: 'customer', planId: $planId);
$reach = $this->broadcasts->preview($creator, $project, $draft); // $reach->count, ->etaSeconds, ->etaFormatted
$sent = $this->broadcasts->send($creator, $project, $draft);The message is canonical HTML, 1 to 4096 characters, which every connector renders in its own markup. Preview the draft and show the creator the exact text and the count before sending, because a broadcast cannot be recalled once queued and every recipient is a person. The send queues it through the dashboard's own action and answers the same reach.
Refusals
BroadcastRefused carries a stable reason: creator_unknown, project_unknown, no_connection (the project runs no live installation to send through), invalid (an empty or oversized body, an audience the core does not know, a plan on an audience that takes none or a plan of another project, a pass audience without its window; the message is the core's translated sentence), tier_required (a pass audience without the passes capability) and not_permitted.
A connector that binds Announcer posts the broadcast once in its announcement place and the core skips the per-member copies for accounts that did not ask for one; a connector that does not still sends per member.
How is this guide?
Last updated on
Access Codes
A plan's access codes as a connector's creator surface prices, generates, lists and revokes them — a batch priced before it is queued, delivered to the creator on their account, and never handed back in full.
Payment Setup
A project's payment methods as a connector's creator surface sets them up — the gateways on offer with the keys each needs, a method configured from its keys or connected through the gateway's own onboarding, switched and removed, checked the way the dashboard checks it.