mailersend.ts
mailersend.ts copied to clipboard
📫 Lightweight MailerSend Node.js api written in TypeScript
🚀 Install
Install it locally in your project
npm i --save @nurodev/mailersend.ts
# Or with Yarn
yarn add @nurodev/mailersend.ts
🦄 Usage
Here are 2 basic examples of how to use the package using either the direct function handler or the client instance model:
import { sendEmail } from "@nurodev/mailersend.ts";
const result = await sendEmail("API_KEY", {
from: {
email: "[email protected]",
name: "Elon Musk",
},
to: [
{
email: "[email protected]",
name: "Tim Apple",
},
],
subject: "The future of humanity...",
html: "<h1>Hello World</h1>",
text: "Hello World",
});
import { Client } from "@nurodev/mailersend.ts";
const client = new Client("API_KEY");
const result = await client.sendEmail({
from: {
email: "[email protected]",
name: "Elon Musk",
},
to: [
{
email: "[email protected]",
name: "Tim Apple",
},
],
subject: "The future of humanity...",
html: "<h1>Hello World</h1>",
text: "Hello World",
});
📕 Documentation
To view the documentation on how to use each module, view the README.md for each module:
- 🔥 Activity
- 📈 Analytics
- 🏠 Domains
- 💬 Messages
- 🫂 Recipients
- 📆 Scheduled Messages
- 🏗️ Templates
- 🔑 Tokens
- 🪝 Webhooks