> For the complete documentation index, see [llms.txt](https://learn.mechanic.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.mechanic.dev/faq/how-do-i-preview-email-attachments.md).

# How do I preview email attachments?

### What won't work

For tasks that use [the Email action](/core/actions/email.md), you'll see a preview of the email itself in the task preview area.

![](https://s3.amazonaws.com/helpscout.net/docs/assets/5ddd799f2c7d3a7e9ae472fc/images/600f41e32e764327f87c22a8/file-PldK5WTNBy.png)

This preview includes an "Expand preview" button, which *then* allows you to send a copy of the message to the email address of your choice.

Importantly, *this feature does not include attachments*. (Under the hood, this is because compiling attachments can take an unpredictable amount of system resources, making this job best served by [Mechanic's run system](/core/runs.md).)

### What will work

The best way to approach this is by creating a brand new task, which...

* ... subscribes to mechanic/user/trigger, allowing you to run the task on demand
* ... uses [the Files action](/core/actions/files.md), using the same data that you're using in your "email" action's attachments

(This technique leverages the fact that Mechanic generates files in the same way, across the "email" and "files" actions; see [File generators](/core/actions/file-generators.md) for more on this.)

In order to make this work, you may need to pull in data needed for your files. For example, if you're working on an email attachment based on order data, you may need to pull in a sample order object, like this:

```liquid
{% assign order = shop.orders[1234567890] %}
```

Using this technique gives you a dedicated workspace, in the form of a task, for iterating on your file attachments. Once you have your attachment-generating code the way you want it, bring that code back to your original task.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://learn.mechanic.dev/faq/how-do-i-preview-email-attachments.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
