# 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
