0.0.9 ā€¢ Published 2 months ago

emailer-kit v0.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

emailer-kit

emailer-kit is a Node.js utility for simplifying email sending using Nodemailer. It provides a streamlined interface to easily send HTML emails with Nodemailer configurations.

NPM

NPM NPM NPM

Features

  • šŸ“§ Send HTML emails effortlessly
  • šŸŒ Compatible with various email service providers
  • šŸ› ļø Simplifies Nodemailer configuration
  • šŸ“¦ Lightweight and easy to use
  • šŸ“š Supports both es6 modules and commonjs
  • šŸ“œ Written in TypeScript
  • šŸ—ƒļø Coming soon: Support for attachments

Installation

npm install emailer-kit

# or

yarn add emailer-kit

Configuration

emailer-kit uses Nodemailer to send emails. You can configure Nodemailer by setting environment variables

Environment Variables

Create a .env file in the root of your project and add the following environment variables:

NODEMAIL_SERVICE= [email service provider e.g. 'outlook' or 'gmail' or 'yahoo' etc.]
NODEMAIL_EMAIL= [your email address]
NODEMAIL_PASSWORD= [your email password]

NOTE : If you are using gmail, you need app password. You can create an app password by going to your Google account settings and then to the security tab.

Usage

import { emailer } from "emailer-kit";

// if you are not using commonjs then use require instead of import as shown below
// const { emailer } = require("emailer-kit");

async function sendTestEmail() {
  const email = "email@example.com";
  const subject = "Test Subject";
  const htmlContent = "<p>This is a test email.</p>";

  try {
    const info = await emailer(email, subject, htmlContent);
    console.log("Email sent:", info.response);
  } catch (error) {
    console.error("Error sending email:", error);
  }
}

sendTestEmail();

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate.

Author

šŸ‘¤ Md Rifat Hossen Saown

Show your support

Give a ā­ļø if this project helped you!

0.0.9

2 months ago

0.0.8

2 months ago

0.0.7

2 months ago

0.0.6

2 months ago

0.0.5

2 months ago

0.0.4

2 months ago

0.0.3

2 months ago

0.0.2

2 months ago