Inject content and optionally merge fields into a template, returning the HTML that results
Signature
public function render(string
$template_name,
array
$template_content,
[array
$merge_vars = NULL] )
Parameters
$template_name
—
string
the immutable name of a template that exists in the user's account
$template_content
—
array
an array of template content to render. Each item in the array should be a struct with two keys - name: the name of the content block to set the content for, and content: the actual content to put into the block - template_content[] struct the injection of a single piece of content into a single editable region - name string the name of the mc:edit editable region to inject into - content string the content to inject
$merge_vars
—
array
optional merge variables to use for injecting merge field content. If this is not provided, no merge fields will be replaced. - merge_vars[] struct a single merge variable - name string the merge variable's name. Merge variable names are case-insensitive and may not start with _ - content string the merge variable's content
Returns
struct
the result of rendering the given template with the content and merge field values injected - html string the rendered HTML as a string