function sendEmailWithTemplate($from, $to, $templateId, $templateModel, $inlineCss = true,
		$tag = NULL, $trackOpens = true, $replyTo = NULL,
		$cc = NULL, $bcc = NULL, $headers = NULL, $attachments = NULL, 
		$trackLinks = NULL, $metadata = NULL) {

		$body = array();
		$body['From'] = $from;
		$body['To'] = $to;
		$body['Cc'] = $cc;
		$body['Bcc'] = $bcc;
		$body['Tag'] = $tag;
		$body['ReplyTo'] = $replyTo;
		$body['Headers'] = $this->fixHeaders($headers);
		$body['TrackOpens'] = $trackOpens;
		$body['Attachments'] = $attachments;
		$body['TemplateModel'] = $templateModel;
		$body['TemplateId'] = $templateId;
		$body['InlineCss'] = $inlineCss;
		$body['Metadata'] = $metadata;
		
		
		// Since this parameter can override a per-server setting
		// we have to check whether it was actually set.
		// And only include it in the API call if that is the case.
		if ($trackLinks !== NULL) {
			$body['TrackLinks'] = $trackLinks;
		}


		return new DynamicResponseModel($this->processRestRequest('POST', '/email/withTemplate', $body));
	}
function sendEmailWithTemplate($from, $to, $templateId, $templateModel, $inlineCss = true,
		$tag = NULL, $trackOpens = true, $replyTo = NULL,
		$cc = NULL, $bcc = NULL, $headers = NULL, $attachments = NULL, 
		$trackLinks = NULL, $metadata = NULL) {

		$body = array();
		$body['From'] = $from;
		$body['To'] = $to;
		$body['Cc'] = $cc;
		$body['Bcc'] = $bcc;
		$body['Tag'] = $tag;
		$body['ReplyTo'] = $replyTo;
		$body['Headers'] = $this->fixHeaders($headers);
		$body['TrackOpens'] = $trackOpens;
		$body['Attachments'] = $attachments;
		$body['TemplateModel'] = $templateModel;
		$body['TemplateId'] = $templateId;
		$body['InlineCss'] = $inlineCss;
		$body['Metadata'] = $metadata;
		
		
		// Since this parameter can override a per-server setting
		// we have to check whether it was actually set.
		// And only include it in the API call if that is the case.
		if ($trackLinks !== NULL) {
			$body['TrackLinks'] = $trackLinks;
		}


		return new DynamicResponseModel($this->processRestRequest('POST', '/email/withTemplate', $body));
	}
function sendEmailWithTemplate ( $ from , $ to , $ templateId , $ templateModel , $ inlineCss = true , $ tag = NULL , $ trackOpens = true , $ replyTo = NULL , $ cc = NULL , $ bcc = NULL , $ headers = NULL , $ attachments = NULL , $ trackLinks = NULL , $ metadata = NULL ) { $ body = array ( ) ; $ body [ 'From' ] = $ from ; $ body [ 'To' ] = $ to ; $ body [ 'Cc' ] = $ cc ; $ body [ 'Bcc' ] = $ bcc ; $ body [ 'Tag' ] = $ tag ; $ body [ 'ReplyTo' ] = $ replyTo ; $ body [ 'Headers' ] = $ this -> fixHeaders ( $ headers ) ; $ body [ 'TrackOpens' ] = $ trackOpens ; $ body [ 'Attachments' ] = $ attachments ; $ body [ 'TemplateModel' ] = $ templateModel ; $ body [ 'TemplateId' ] = $ templateId ; $ body [ 'InlineCss' ] = $ inlineCss ; $ body [ 'Metadata' ] = $ metadata ; // Since this parameter can override a per-server setting // we have to check whether it was actually set. // And only include it in the API call if that is the case. if ( $ trackLinks !== NULL ) { $ body [ 'TrackLinks' ] = $ trackLinks ; } return new DynamicResponseModel ( $ this -> processRestRequest ( 'POST' , '/email/withTemplate' , $ body ) ) ; }
Send an email using a template.

@param  string $from The sender of the email. (Your account must have an associated Sender Signature for the address used.)
@param  string $to The recipient of the email.
@param  integer $templateId  The ID of the template to use to generate the content of this message.
@param  array $templateModel  The values to combine with the Templated content.
@param  boolean $inlineCss  If the template contains an HTMLBody, CSS is automatically inlined, you may opt-out of this by passing 'false' for this parameter.
@param  string $tag  A tag associated with this message, useful for classifying sent messages.
@param  boolean $trackOpens  True if you want Postmark to track opens of HTML emails.
@param  string $replyTo  Reply to email address.
@param  string $cc  Carbon Copy recipients, comma-separated
@param  string $bcc  Blind Carbon Copy recipients, comma-separated.
@param  array $headers  Headers to be included with the sent email message.
@param  array $attachments  An array of PostmarkAttachment objects.
@param  string $trackLinks  Can be any of "None", "HtmlAndText", "HtmlOnly", "TextOnly" to enable link tracking.
@param  array $metadata  Add metadata to the message. The metadata is an associative array , and values will be evaluated as strings by Postmark.
@return DynamicResponseModel
Send an email using a template .