# Render Templates content

Add the following code to `./template/new-email-1.php` to enable developers to retrieve template content effectively.

```php
<?php

use NewEmail1;

defined( 'ABSPATH' ) || exit;

$template = YourNewEmail::get_instance()->template;

if ( ! empty( $template ) ) {
    $content = $template->get_content( $args );
    yaymail_kses_post_e( $content );
}

```

The `args` variable is an input parameter for the `get_content_html` function within this file. It contains various email details, including the order, email heading, additional content, sent to admin, plain text, and more...

<figure><img src="/files/pxCpUpg0xtQBTr4UGqZt" alt=""><figcaption></figcaption></figure>

Upon receiving the specified variable, this code checks whether the template exists. If it does, the code retrieves the content based on `args` passed in


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.yaycommerce.com/yaymail/developer-zone/api/register-templates/render-templates-content.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
