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

# Send email using eusend

> Learn how to send an email using Vuemail and the eusend Node.js SDK.

## 1. Install dependencies

Get the [@vuemaildev/vuemail](https://www.npmjs.com/package/@vuemaildev/vuemail) package and the [eusend Node.js SDK](https://www.npmjs.com/package/@eusend_dev/sdk).

```sh npm theme={null}
npm install @eusend_dev/sdk @vuemaildev/vuemail
```

```sh yarn theme={null}
yarn add @eusend_dev/sdk @vuemaildev/vuemail
```

```sh pnpm theme={null}
pnpm add @eusend_dev/sdk @vuemaildev/vuemail
```

```sh bun theme={null}
bun add @eusend_dev/sdk @vuemaildev/vuemail
```

## 2. Create an email using Vue

Start by building your email template in a `.vue` file.

```vue email.vue theme={null}
<script setup lang="ts">
import { Button, Html } from '@vuemaildev/vuemail';

const { url } = defineProps<{ url: string }>();
</script>

<template>
  <Html lang="en">
    <Button :href="url">Click me</Button>
  </Html>
</template>
```

## 3. Convert to HTML and send email

> [!NOTE]
>
> When integrating with other services, you need to convert your Vue template into HTML before sending, which is what `render` does.

Import the email template you just built, convert it into an HTML string, and use the eusend SDK to send it.

```ts theme={null}
import { Eusend } from "@eusend_dev/sdk";
import { render } from '@vuemaildev/vuemail';
import Email from './email.vue';

const eusend = new Eusend(process.env.EUSEND_API_KEY);

await eusend.emails.send({
  from: "you@example.com",
  to: "user@gmail.com",
  subject: "hello world",
  html: await render(Email, { url: 'https://example.com' }),
});
```

## Try it yourself

> **[eusend example](https://github.com/psycarlo/vuemail/tree/main/examples/eusend)**
>
> See the full source code.


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