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));
	}