public validateTemplate ( string $subject = NULL, string $htmlBody = NULL, string $textBody = NULL, object $testRenderModel = NULL, boolean $inlineCssForHtmlTestRender = true ) : Postmark\Models\DynamicResponseModel | ||
$subject | string | The Subject template you wish to test. |
$htmlBody | string | The HTML template you wish to test |
$textBody | string | The number of templates to "Skip" before returning results. |
$testRenderModel | object | The model to be used when doing test renders of the templates that successfully parse in this request. |
$inlineCssForHtmlTestRender | boolean | If htmlBody is specified, the test render will automatically do CSS Inlining for the HTML content. You may opt-out of this behavior by passing 'false' for this parameter. |
return | Postmark\Models\DynamicResponseModel |
function validateTemplate($subject = NULL, $htmlBody = NULL, $textBody = NULL, $testRenderModel = NULL, $inlineCssForHtmlTestRender = true)
{
$query = array();
$query["subject"] = $subject;
$query["htmlBody"] = $htmlBody;
$query["textBody"] = $textBody;
$query["testRenderModel"] = $testRenderModel;
$query["inlineCssForHtmlTestRender"] = $inlineCssForHtmlTestRender;
return new DynamicResponseModel($this->processRestRequest('POST', "/templates/validate", $query));
}
function testClientCanValidateTemplate() { $tk = parent::$testKeys; $client = new PostmarkClient($tk->WRITE_TEST_SERVER_TOKEN, $tk->TEST_TIMEOUT); $result = $client->validateTemplate("{{subject}}", "Hello <b>{{name}}</b>!", "Hello {{name}}!", NULL, false); $this->assertNotEmpty($result); }