> 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/email-hooks/adding-custom-hook.md).

# Adding Custom Hook

First, you need to declare your custom hook via the following PHP code:<br>

```
 add_action(
            'your_custom_hook',
            function( $data ) {
                $render_data = isset( $data['render_data'] ) ? $data['render_data'] : [];
                $order       = isset( $render_data['order'] ) ? $render_data['order'] : null;
                echo 'Your content';
            }
        );
```

Then, in the Hook element, please choose Custom and type in the input

```
[yaymail_custom_hook hook="your_custom_hook"]
```

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