Appearance
Rule.io SDK / client/src / SetEmailCampaignPayload
Interface: SetEmailCampaignPayload
Defined in: client/src/resources/campaigns/campaigns.types.ts:234
Payload for CampaignsClient.setEmailCampaign (full replacement).
All five fields are required — the API replaces the entire campaign body. Omitted fields revert to API defaults, not the previous values.
The message type is fixed to 'email' by the method. If the campaign does not yet exist the SDK falls back to a create using createEmailCampaign() semantics.
Example
typescript
await client.campaigns.setEmailCampaign(campaignId, {
name: 'Spring Newsletter',
sendoutType: 'marketing',
tags: [{ id: 42, negative: false }],
segments: [],
subscribers: [],
});Properties
name
name:
string
Defined in: client/src/resources/campaigns/campaigns.types.ts:236
Campaign name. Required.
segments
segments:
CampaignRecipientSegment[]
Defined in: client/src/resources/campaigns/campaigns.types.ts:247
Segment recipient filters. Pass an empty array to clear all segment filters.
sendoutType
sendoutType:
CampaignSendoutType
Defined in: client/src/resources/campaigns/campaigns.types.ts:243
Sendout type. Required.
'marketing' = standard marketing email. 'transactional' = triggered transactional email.
subscribers
subscribers:
number[]
Defined in: client/src/resources/campaigns/campaigns.types.ts:249
Individual subscriber IDs. Pass an empty array to clear all.
tags
tags:
CampaignRecipientTag[]
Defined in: client/src/resources/campaigns/campaigns.types.ts:245
Tag recipient filters. Pass an empty array to clear all tag filters.