0
const campaign = {
                type: 'regular',
                recipients: {
                list_id: '11a07e4453'
                },
                settings: {
                subject_line: 'New Blog Post: TITLE',
                from_name: 'YOUR_NAME',
                reply_to: 'YOUR_EMAIL'
                },
                content: {
                type: 'template',
                template: {
                    id: '31036'
                }
                }
            };

            mailchimp.campaigns.create(campaign)
            .then(response => console.log(response))
            .catch(error => console.error(error));
async function run() {
    const response = await mailchimp.ping.get();
    console.log('lets seeeeeeee', response);
}

run();

ping method successfully runs but I can't seem to work mailchimp.campaigns.create(campaign).

I don't what is missing but this gives me error Error: Bad Request

0 Answers0