Create a campaign

Using the SDK

from cakemail.models import CreateCampaign, Audience, Tracking, Sender, Content

campaign = api.campaign.create(
    CreateCampaign(
        name='<campaign name>',
        audience=Audience(
            list_id=<list ID>
        ),
        tracking=Tracking(
            opens=true,
            clicks_html=true,
            clicks_text=true
        ),
        sender=Sender(
            id='<confirmed sender ID>'
        ),
        content=Content(
            subject='<subject>',
            html='<HTML content>',
            text='<text content>',
            encoding='utf-8'
        )
    )
)
<?php

$campaign = $api->campaign->create([
    'create_campaign' => new \Cakemail\Lib\Model\CreateCampaign([
        'name' => '<campaign name>',
        'audience' => new \Cakemail\Lib\Model\Audience([
            'list_id' => <list ID>
        ]),
        'tracking' => new \Cakemail\Lib\Model\Tracking([
            'opens' => true,
            'clicks_html' => true,
            'clicks_text' => true
        ]),
        'sender' => new \Cakemail\Lib\Model\Sender([
            'id' => '<confirmed sender ID>'
        ]),
        'content' => new \Cakemail\Lib\Model\Content([
            'subject' => '<subject>',
            'html' => '<HTML content>',
            'text' => '<text content>',
            'encoding' => 'utf-8'
        ])
    ])
]);
Language
Authentication
OAuth2
Click Try It! to start a request and see the response here!