> ## Documentation Index
> Fetch the complete documentation index at: https://docs.emailux.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Send an Email Studio template with the API

> Render an EmailUX template to HTML or deliver it through SendGrid, Gmail or SMTP using the @emailux/api-client package.

**1. Create an API key**

In your EmailUX dashboard, create an API key and store it as `EMAILUX_API_KEY`.

**2. Install the client**

```sh theme={null}
npm install @emailux/api-client
```

**3. Render to HTML**

```ts theme={null}
import { EmailUxApiClient } from '@emailux/api-client';

const client = new EmailUxApiClient({
  apiKey: process.env.EMAILUX_API_KEY!,
  sendgridDomain: 'mail.yourdomain.com',
});

const result = await client.render({
  experienceId: 'welcome-email',
  locale: 'en-US',
  data: { firstName: 'Ada' },
});
```

Enable the template for that SendGrid domain with **Set SendGrid domain** or **Manage templates**; a template with no live version is not available until one is marked live.

**4. Or deliver it**

`deliver()` renders and queues the send through your connected provider. See the [API client reference](https://docs.emailux.com/api/api-client.md) for provider options and response codes.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.