> For the complete documentation index, see [llms.txt](https://docs.yaycommerce.com/yaymail/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yaycommerce.com/yaymail/developer-zone/api/register-templates/register-new-template.md).

# Register new template

To register new emails, developers should use the following code:

```php
public function register_emails( $yaymail_emails ) {
    $yaymail_emails->register( YourNewEmail::get_instance());
}

add_action( 'yaymail_register_emails', 'register_emails' );
```

This code attaches to the `yaymail_register_emails` action hook. It is used to register new email templates by passing the email instance.
