lib/API/CampaignsApi.php
/**
     * Operation createCampaignAsyncWithHttpInfo
     *
     * Create New Campaign
     *
     * @param  string $list_id The list you will send the campaign to. (required)
     * @param  string $template_id The template that will define the content of the page. Note: the Email Template is copied when creating this campaign, so future changes to that Email Template will not alter the content of this campaign. (required)
     * @param  string $from_email The email address your email will be sent from and will be used in the &#x60;reply-to&#x60; header. (required)
     * @param  string $from_name The name or label associated with the email address you&#39;re sending from. (required)
     * @param  string $subject The email subject of the campaign (required)
     * @param  string $name If not specified, this will default to the subject of the campaign. (optional, default to 'Campaign Name')
     * @param  bool $use_smart_sending If set, limits the number of emails sent to an individual within a short period. Valid values are &#x60;true&#x60; and &#x60;false&#x60;. If not specified, defaults to &#x60;true&#x60;. (optional, default to true)
     * @param  bool $add_google_analytics If specified, adds Google Analytics tracking tags to links. Valid values are &#x60;true&#x60; and &#x60;false&#x60;. If not specified, defaults to &#x60;false&#x60;. (optional, default to false)
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
Operation createCampaignAsyncWithHttpInfo
Create New Campaign

@param  string $list_id The list you will send the campaign to. (required)
@param  string $template_id The template that will define the content of the page. Note: the Email Template is copied when creating this campaign, so future changes to that Email Template will not alter the content of this campaign. (required)
@param  string $from_email The email address your email will be sent from and will be used in the `reply-to` header. (required)
@param  string $from_name The name or label associated with the email address you're sending from. (required)
@param  string $subject The email subject of the campaign (required)
@param  string $name If not specified, this will default to the subject of the campaign. (optional, default to 'Campaign Name')
@param  bool $use_smart_sending If set, limits the number of emails sent to an individual within a short period. Valid values are `true` and `false`. If not specified, defaults to `true`. (optional, default to true)
@param  bool $add_google_analytics If specified, adds Google Analytics tracking tags to links. Valid values are `true` and `false`. If not specified, defaults to `false`. (optional, default to false)


Operation createCampaignAsyncWithHttpInfo Create New Campaign @param string $list_id The list you will send the campaign to . ( required ) @param string $template_id The template that will define the content of the page . Note : the Email Template is copied when creating this campaign so future changes to that Email Template will not alter the content of this campaign . ( required ) @param string $from_email The email address your email will be sent from and will be used in the ` reply - to ` header . ( required ) @param string $from_name The name or label associated with the email address you ' re sending from . ( required ) @param string $subject The email subject of the campaign ( required ) @param string $name If not specified this will default to the subject of the campaign . ( optional default to ' Campaign Name ' ) @param bool $use_smart_sending If set limits the number of emails sent to an individual within a short period . Valid values are ` true ` and ` false ` . If not specified defaults to ` true ` . ( optional default to true ) @param bool $add_google_analytics If specified adds Google Analytics tracking tags to links . Valid values are ` true ` and ` false ` . If not specified defaults to ` false ` . ( optional default to false )
public function createCampaignAsyncWithHttpInfo($list_id, $template_id, $from_email, $from_name, $subject, $name = 'Campaign Name', $use_smart_sending = true, $add_google_analytics = false)
    {
        $returnType = 'array<string,object>';
        $request = $this->createCampaignRequest($list_id, $template_id, $from_email, $from_name, $subject, $name, $use_smart_sending, $add_google_analytics);
        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); 
                    } else {
                        $content = (string) $response->getBody();
                    }
                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }
public function createCampaignAsyncWithHttpInfo ( $ list_id , $ template_id , $ from_email , $ from_name , $ subject , $ name = 'Campaign Name' , $ use_smart_sending = true , $ add_google_analytics = false ) { $ returnType = 'array<string,object>' ; $ request = $ this -> createCampaignRequest ( $ list_id , $ template_id , $ from_email , $ from_name , $ subject , $ name , $ use_smart_sending , $ add_google_analytics ) ; return $ this -> client -> sendAsync ( $ request , $ this -> createHttpClientOption ( ) ) -> then ( function ( $ response ) use ( $ returnType ) { if ( $ returnType === '\SplFileObject' ) { $ content = $ response -> getBody ( ) ; } else { $ content = ( string ) $ response -> getBody ( ) ; } return [ ObjectSerializer :: deserialize ( $ content , $ returnType , [ ] ) , $ response -> getStatusCode ( ) , $ response -> getHeaders ( ) ] ; } , function ( $ exception ) { $ response = $ exception -> getResponse ( ) ; $ statusCode = $ response -> getStatusCode ( ) ; throw new ApiException ( sprintf ( '[%d] Error connecting to the API (%s)' , $ statusCode , $ exception -> getRequest ( ) -> getUri ( ) ) , $ statusCode , $ response -> getHeaders ( ) , ( string ) $ response -> getBody ( ) ) ; } ) ; }
Operation createCampaignAsyncWithHttpInfo
 Create New Campaign
Operation createCampaignAsyncWithHttpInfo Create New Campaign
//stream goes to serializer