Socket
Book a DemoInstallSign in
Socket

maileroo

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

maileroo

This repository contains Node.js SDK to help you integrate with Maileroo's email sending API efficiently and effectively.

0.0.3
latest
npmnpm
Version published
Weekly downloads
28
75%
Maintainers
1
Weekly downloads
 
Created
Source

Maileroo Node.js Client

Overview

Welcome to the official Node.js SDK for Maileroo, a powerful and flexible email sending API. This SDK allows you to easily integrate Maileroo's email sending capabilities into your PHP applications.

Features

  • Send basic and template-based emails
  • Add attachments and inline attachments
  • Manage contacts (create, update, delete, and list)
  • Generate unique reference IDs for email tracking
  • Chainable methods for setting email data

Installation

npm install maileroo

Usage

Initialization

const { MailerooClient } = require('maileroo');

const apiKey = 'your_api_key';
const mailerooClient = MailerooClient.getClient(apiKey);

Sending an Email

Basic Email

await mailerooClient
  .setFrom('John Doe', 'john@example.com')
  .setTo('Jane Smith', 'jane@example.com')
  .setSubject('Hello World!')
  .setHtml('<h1>Welcome</h1>')
  .setPlain('Welcome')
  .sendBasicEmail();

Template Email

await mailerooClient
  .setFrom('John Doe', 'john@example.com')
  .setTo('Jane Smith', 'jane@example.com')
  .setTemplateId('template_id')
  .setTemplateData({ name: 'Jane' })
  .sendTemplateEmail();

Managing Attachments

mailerooClient.addAttachment('./path/to/file.pdf', 'file.pdf', 'application/pdf');
mailerooClient.addInlineAttachment('./path/to/image.png', 'image.png', 'image/png');

Contact Management

Create Contact

await mailerooClient.createContact('list_id', { email: 'jane@example.com', name: 'Jane Smith' });

Update Contact

await mailerooClient.updateContact('list_id', 'jane@example.com', { name: 'Jane Doe' });

Delete Contact

await mailerooClient.deleteContact('list_id', 'jane@example.com');

Get Contact

const contact = await mailerooClient.getContact('list_id', 'jane@example.com');
console.log(contact);

List Contacts

const contacts = await mailerooClient.listContacts('list_id', 'query', 1);
console.log(contacts);

Error Handling

The library throws errors if an API request fails. Use try-catch blocks to handle these errors gracefully:

try {
  await mailerooClient.sendBasicEmail();
} catch (error) {
  console.error(error.message);
}

License

This library is distributed under the MIT License. Feel free to use and modify it.

FAQs

Package last updated on 23 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.