> ## 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 Scaleway Transactional Email

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

## 1. Install dependencies

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

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

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

```sh pnpm theme={null}
pnpm add @scaleway/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

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

```ts theme={null}
import { render } from '@vuemaildev/vuemail';
import { TransactionalEmail, createClient } from "@scaleway/sdk";
import Email from './email.vue';

const client = createClient({
  accessKey: process.env.ACCESS_KEY,
  secretKey: process.env.SECRET_KEY,
  defaultProjectId: process.env.PROJECT_ID,
  defaultRegion: "fr-par",
  defaultZone: "fr-par-1",
});

const transactionalEmailClient = new TransactionalEmail.v1alpha1.API(client);

const emailHtml = await render(Email, { url: 'https://example.com' });

const sender = {
  email: "vuemail@transactional.email.fr",
  subject: "TEST",
  name: "Team",
};

const userInvited = {
  email: "XXXX@scaleway.com",
  name: "TEST",
  teamName: "Team",
};

const userInvitedBy = {
  email: "XXXX@scaleway.com",
  name: "TEST",
  teamName: "Team",
};

transactionalEmailClient.createEmail({
  from: {
    email: sender.email,
    name: sender.name,
  },
  to: [
    {
      email: userInvited.email,
      name: userInvited.name,
    },
  ],
  subject: sender.subject,
  text: null,
  html: emailHtml,
});
```

## Try it yourself

> **[Scaleway Transactional Email](https://github.com/psycarlo/vuemail/tree/main/examples/scaleway)**
>
> See the full source code.


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