Deno

Call the Resent HTTP API from Deno Deploy or Deno scripts.

Call the Resent HTTP API from Deno Deploy or Deno scripts.

Install

$npm i resent.one

Set RESENT_API_KEY in your server environment. Keep the key off the client.

Send an email

1const apiKey = Deno.env.get("RESENT_API_KEY");
2
3const response = await fetch("https://resent.one/api/v1/email/send", {
4 method: "POST",
5 headers: {
6 Authorization: `Bearer ${apiKey}`,
7 "Content-Type": "application/json",
8 },
9 body: JSON.stringify({
10 from: "Acme <noreply@yourdomain.com>",
11 to: ["you@example.com"],
12 subject: "Hello from Deno",
13 html: "<strong>It works!</strong>",
14 }),
15});
16
17console.log(await response.json());

Next steps