Prepare a permission-based audience
Marketing uses a project management key. Broadcasts open automatically once the account has a record of clean transactional sending. Create an audience, add subscribers with recorded explicit permission, create a broadcast, preview, then schedule. Unsubscribe preferences apply to marketing within the project; essential transactional mail remains separate.
const audience = await panda.audiences.create("Product updates");
await panda.audiences.addContacts(
audience.id,
[
{
email: "subscriber@example.com",
consent: {
at: "2026-10-01T12:00:00Z",
source: "signup",
evidence: "Product update form v1; explicit marketing opt-in",
},
},
],
{ permissionConfirmed: true },
);
const broadcast = await panda.campaigns.create({
name: "October update",
audience_id: audience.id,
from: "Your product <hello@yourdomain.com>",
subject: "Here’s what’s new",
text: "Your update goes here.",
postal_address: "Your actual business postal address",
});
await panda.campaigns.preview(broadcast.id);
// Review the message and audience before scheduling.
await panda.campaigns.schedule(broadcast.id, { permissionConfirmed: true });
const report = await panda.campaigns.get(broadcast.id);
These methods are in SDK 0.2.0. REST resources: /v1/audiences, /v1/contacts and /v1/campaigns; use the interactive API reference for schemas. Each recipient gets a personal unsubscribe footer and one-click headers. Scheduled broadcasts retain a fixed audience and content; later opt-outs and suppressions are still checked before submission. Pause/resume/cancel are available; messages already in flight cannot be recalled. Reports distinguish provider submission from recipient delivery.
Review before scheduling
Confirm the audience, sender, subject, message and postal address. Preview the rendered output and use a test send to a chosen recipient before scheduling. Tests are real sends and use normal sending quota. Marketing readiness and verified sending-domain checks still apply.
Handle opt-outs and reports
SendPanda adds personal unsubscribe links and one-click headers. Marketing preferences apply within the project; essential transactional email remains separate. Do not re-add opted-out contacts without renewed permission evidence.
Reports distinguish provider submission from recipient delivery. Pausing stops work not yet in flight; already submitted messages cannot be recalled. After a transport failure during scheduling or resuming, read the campaign state before retrying. These mutations are not automatically retried by the SDK.