# email

Sends an email with HTML content. The content between the opening and closing tags becomes the email body.

```liquid
{% email to: "customer@example.com", subject: "Order Confirmation" %}
  <h1>Thank you for your order!</h1>
  <p>Your order #{{ order.name }} has been confirmed.</p>
  <p>Total: {{ order.total_price | money }}</p>
{% endemail %}
```

#### Syntax

```liquid
{% email to: "recipient@example.com", subject: "Subject line" %}
  HTML content here...
{% endemail %}
```

#### Parameters

| Parameter     | Required | Description             |
| ------------- | -------- | ----------------------- |
| `to`          | Yes      | Recipient email address |
| `subject`     | No       | Email subject line      |
| `cc`          | No       | CC recipient(s)         |
| `bcc`         | No       | BCC recipient(s)        |
| `replyTo`     | No       | Reply-to email address  |
| `attachments` | No       | File attachments        |

#### Examples

**Basic email:**

```liquid
{% email to: "admin@store.com", subject: "Daily Report" %}
  <h2>Sales Report for {{ "now" | date: "%B %d, %Y" }}</h2>
  <p>Total orders: {{ orders.size }}</p>
{% endemail %}
```

**With CC and Reply-To:**

```liquid
{% email
  to: "customer@example.com",
  cc: "sales@store.com",
  replyTo: "support@store.com",
  subject: "Your Invoice"
%}
  <p>Please find your invoice attached.</p>
{% endemail %}
```

**Dynamic recipient:**

```liquid
{% for customer in customers %}
  {% email to:customer.email, subject:"Special Offer Just for You" %}
    <p>Hi {{ customer.first_name }},</p>
    <p>We have a special offer waiting for you!</p>
  {% endemail %}
{% endfor %}
```

**With attachments:**

```liquid
{% email
  to: "customer@example.com",
  subject: "Your Report",
  attachments: report_files
%}
  <p>Please find your requested reports attached.</p>
{% endemail %}
```

#### Notes

* Emails are sent from DataJet's verified sender address
* Daily email limit applies per store
* Store must be trusted and have email sending enabled
* HTML content is supported in the email body
* Each email sent consumes 1 credit


---

# 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.datajet-app.com/liquid/tags/email.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.
