# Using a Hook in YayMail

### Using a Hook in YayMail <a href="#using-a-hook-in-yaymail" id="using-a-hook-in-yaymail"></a>

<figure><img src="https://docs.yaycommerce.com/yaymail/~gitbook/image?url=https%3A%2F%2F157604815-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MJfBhHG_1ipE5lMX4qT%252Fuploads%252FzXTxOKi18KIsPo6JBnB3%252Fimage.png%3Falt%3Dmedia%26token%3D9878f32b-39ea-46fb-bfd3-d92e9e02dd44&#x26;width=768&#x26;dpr=3&#x26;quality=100&#x26;sign=40cbbedc&#x26;sv=2" alt=""><figcaption></figcaption></figure>

To use one of the above hooks:

1. **Open** your email template (e.g., Processing Order, Completed Order).
2. **Add a WooCommerce Element** called **"Hook"** and click to edit it.
3. Under the **Hook** dropdown:
   * Select one of the available WooCommerce hooks: `woocommerce_email_before_order_table`, `woocommerce_email_after_order_table.`
4. Customize the padding, background, text color, and other styles.

<figure><img src="https://docs.yaycommerce.com/yaymail/~gitbook/image?url=https%3A%2F%2F157604815-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MJfBhHG_1ipE5lMX4qT%252Fuploads%252FtF7WoZia71tPXspMw4f4%252Fimage.png%3Falt%3Dmedia%26token%3D450494dc-d55c-48aa-84fb-588f67154ad4&#x26;width=768&#x26;dpr=3&#x26;quality=100&#x26;sign=fc644b72&#x26;sv=2" alt=""><figcaption></figcaption></figure>

Save changes!


---

# 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/drag-and-drop-email-builder/the-elements-of-design/using-a-hook-in-yaymail.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.
