# Email Hooks

YayMail supports inserting custom content into WooCommerce transactional emails using predefined **WooCommerce hooks** and **custom hooks**. This gives you full control over **where and how** your content shows up inside each email.

### Available WooCommerce Hooks in YayMail

YayMail includes built-in support for the following standard WooCommerce email action hooks:

#### 1. `woocommerce_email_before_order_table`

* **Description**: Inserts content **before** the order table appears in the email.
* **Use Case**: Great for adding notes, custom greetings, or promotional content at the top of order confirmation emails.
* **Applies to**: All WooCommerce transactional emails that contain order details.

#### 2. `woocommerce_email_after_order_table`

* **Description**: Inserts content **after** the order table in the email.
* **Use Case**: Useful for adding instructions, links to support, or custom messages post order summary.
* **Applies to**: All emails with order content (like processing, completed, on-hold, etc.)

### Some Available 3rd-Party Plugins' Hooks in YayMail

#### 1. `yaydp_on_sale_products`

* **Description**: A custom YayMail hook, from another YayCommerce plugin called 'YayPricing Dynamic Pricing extensions'.
* **Use Case**: Display on-sale or discounted product lists in emails using YayPricing integration.
* **Applies to**: Specific email templates or integrations when dynamic discounts are enabled.

**Plugin:** <https://wordpress.org/plugins/yaypricing/>


---

# 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/email-hooks.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.
