Created by adam186 119 days ago Viewed 53 times 0 Points
Cancel a Regular or Plain-Text Campaign after you send, before all of your recipients receive it. This feature is included with Mailchimp Pro.
No comments yet
import { Resource } from 'https://deno.land/x/windmill@v1.70.1/mod.ts'
export async function main(
auth: Resource<'mailchimp'>,
campaign_id: string
) {
const url = `https://${auth.server}.api.mailchimp.com/3.0/campaigns/${campaign_id}/actions/cancel-send`
const response = await fetch(url, {
method: 'POST',
headers: {
Authorization: `Bearer ${auth.api_key}`
}
})
if(!response.ok) {
throw Error(await response.text())
}
return await response.json()
}
No comments yet