The DeleteTemplate service allows you to delete existing templates within Flexmail.
SOAP Action: DeleteTemplate
SOAP Return Object: DeleteTemplateResp
The following table describes the parameters used for calling the DeleteTemplate service.
Parameter | Mandatory | Type | Description |
---|---|---|---|
header | Y | APIRequestHeader | Header for authentication |
templateType | Y | TemplateType | Template type |
The following table describes the parameters returned from the DeleteTemplate service.
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 |
0 | No error |
---|---|
220 | Authentication error, see header object for detailed information |
221 | Template id is mandatory |
222 | Invalid template id |
223 | Internal error |
This example shows you the deletion of a template width id 712.
<?php $header->userId = USER_ID; $header->userToken = USER_TOKEN; $deleteTemplateReq->header = $header; $deleteTemplateReq->templateType->templateId = 712; $deleteTemplateResp = $SoapClient->__soapCall("DeleteTemplate", array($deleteTemplateReq)); if ($deleteTemplateResp->errorCode == 0) { echo "Template deleted"; } else { echo "Template deletion failed: " . $deleteTemplateResp->errorMessage; } ?>