Service: SendTestCampaign

The SendTestCampaign service allows you to launch a campaign to a single email address. This address does not belong to a mailing list

Service Details

SOAP Action: SendTestCampaign
SOAP Return Object: SendTestCampaignResp

Input

The following table describes the parameters used for calling the SendTestCampaign service.

Table: instance of SendTestCampaignReq

Parameter Mandatory Type Description
header Y APIRequestHeader Header for authentication
testCampaignType Y TestCampaignType Test campaign

Output

The following table describes the parameters returned from the SendTestCampaign service.

Table: instance of SendTestCampaignResp

Parameter Mandatory Type Description
header / APIResponseHeader Header containing authentication information
errorCode / Integer Numerical value of the error
errorMessage / String Short literal description of the error

Table: response codes of SendTestCampaignResp.

0 No error
220 Authentication error, see header object for detailed information
221 Campaign send to email address is mandatory
222 Campaign subject is mandatory
223 Campaign sender email address is mandatory
224 Campaign sender name is mandatory
225 Campaign reply email address is mandatory
226 test campaign name is mandatory
227 test campaign message id is mandatory
228 test campaign message id is invalid

Example

This example shows a test campaign.

<?php
$header->userId = USER_ID;
$header->userToken = USER_TOKEN;

$sendTestCampaignReq->header = $header;
$testCampaignType = new $testCampaignType();
$testCampaignType->testCampaignName = "Test Campaign";
$testCampaignType->testCampaignSendToEmailAddress = "receiver@flexmail.be";
$testCampaignType->testCampaignSubject = "My Test Campaign";
$testCampaignType->testCampaignSenderEmailAddress = "sendBy@infoweb.be";
$testCampaignType->testCampaignSenderName = "Send By";
$testCampaignType->testCampaignReplyEmailAddress = "no-reply@infoweb.be";
$testCampaignType->testCampaignMessageId = 1;

$sendTestCampaignReq->testCampaignType = $testCampaignType;

$sendTestCampaignsResp = $SoapClient->__soapCall("SendTestCampaign", array( $sendTestCampaignReq));

if ($sendTestCampaignResp->errorCode() == 0) {
	echo "Campaign launched";
} else {
	echo "Campaign launch failed: " . $updateCampaignResp->errorMessage;
}
?>