---
name: email
description: "Send emails from WordPress using the configured Email channel. Use when the user asks to send an email, notify someone, email a customer, send a follow-up, or compose and deliver a message. Also trigger when the user wants to check the email configuration or test the email setup. Requires Agent Builder Pro. Do NOT trigger for WooCommerce order emails (those use wc_update_order_status with customer_note) or newsletter campaigns."
---

# Email Skill

## Available Tools

| Tool | When to use |
|---|---|
| `get_email_settings` | Check the Email channel configuration before sending. |
| `send_email` | Send an email to one or more recipients. |

## Before Sending

Always call `get_email_settings` first to confirm:
- The channel is configured (`configured: true`)
- The `from_name` and `from_email` are set correctly
- If the channel is not configured, tell the user to set it up in **Agent Builder → Settings → Email Channel**

## Workflows

### Send a plain-text email

1. Call `get_email_settings` to verify the channel.
2. Draft the email subject and body — show it to the user for approval.
3. Call `send_email` with `to`, `subject`, `body`.
4. Report the confirmed `from` address and recipients.

### Send an HTML email

1. Call `get_email_settings`.
2. Build the HTML body using simple tags: `<h2>`, `<p>`, `<strong>`, `<ul>`, `<a>`.
3. Call `send_email` with `is_html: true`.
4. Note: complex CSS and embedded images are not reliable in email clients — keep HTML minimal.

### Email a WooCommerce customer

1. Call `wc_get_order` or `wc_get_customer` to get the customer email.
2. Compose the message (show draft to user).
3. Call `send_email` with the customer's email as `to`.
4. Optionally call `wc_add_order_note` to record that the email was sent.

## Quality Rules

- **Always show the draft to the user before sending** — email cannot be recalled.
- **Add-on only** — if `get_email_settings` returns `pro_required: true`, stop and tell the user to upgrade; do not attempt to work around this.
- **Plain text is safer** — unless the user asks for HTML, send plain text to maximise deliverability.
- **Validate the `to` address** — the tool validates format, but confirm with the user that the address is correct before sending.
- **CC sparingly** — only add CC if explicitly requested.
- **Never send email in bulk** — this tool sends individual emails; for newsletters use the newsletter/Brevo workflow.
