npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

uncanny-mailer

v1.0.1

Published

A node package to customized mails easily.

Downloads

9

Readme

Uncanny Mailer

Uncanny Mailer is an npm package designed to simplify the process of sending emails using the Gmail service. The package supports sending multiple emails at a time and offers the ability to use HTML content for emails.

Features

  • Send Multiple Emails: Easily send emails to multiple recipients.
  • HTML Support: Send rich HTML content as the body of your emails.
  • Gmail Service: Currently supports Gmail service using app passwords for authentication.

Installation

To install the Uncanny Mailer package, use npm:

npm install uncanny-mailer

Usage

Here’s a basic example of how to use Uncanny Mailer:

import uMailer from 'uncanny-mailer';

const demoMail = 'test/email/demo.html';
const mail = {
    options: {
        from: '"Company Name" <[email protected]>',
        to: ["[email protected]", "[email protected]"], // Can be a single string or an array of strings
        subject: "Hello from Company Name", // optional
        html: demoMail, // optional
        isHtml: true // optional, depending on this it will be parsed
    },
    config: {
        service: "Gmail",
        auth: {
            user: "", // your Gmail address
            pass: "", // app password, refer to the documentation below
        },
    },
};

uMailer(mail);

Configuration

options Object

  • from (string): The sender's email address and name. For example: "Company Name" <[email protected]>.
  • to (string or array of strings): A single recipient email address or a list of recipient email addresses. For example: "[email protected]" or ["[email protected]", "[email protected]"].
  • subject (string, optional): The subject line of the email.
  • html (string, optional): A string or The path to an HTML file to be used as the email body (also a string). If you are giving a HTML file path (file path wrt root of project) you have to provide isHtml: true.
  • isHtml (boolean, optional): If true, the content of the html property will be parsed as HTML.

config Object

  • service (string): The email service to use. Currently, only "Gmail" is supported.
  • auth (object):

Gmail App Password

To use this package, you need to generate an app password for your Gmail account. Follow these steps:

  1. Go to your Google Account.
  2. Select Security.
  3. Under "Signing in to Google," select App Passwords.
  4. You might need to sign in. If you don’t have this option, it might be because:
    • 2-Step Verification is not set up for your account.
    • 2-Step Verification is only set up for security keys.
    • Your account is through work, school, or another organization.
    • You turned on Advanced Protection.
  5. At the bottom, choose Select app and choose the app you’re using.
  6. Choose Select device and choose the device you’re using.
  7. Select Generate.
  8. Follow the instructions to enter the App Password. The App Password is the 16-character code in the yellow bar on your device.
  9. Tap Done.

Example

Here is a complete example of sending an email using the Uncanny Mailer package:

import uMailer from 'uncanny-mailer';

const demoMail = 'test/email/demo.html';
const mail = {
    options: {
        from: '"Company Name" <[email protected]>',
        to: ["[email protected]", "[email protected]"], // Can be a single string or an array of strings
        subject: "Welcome to Company Name",
        html: demoMail,
        isHtml: true,
    },
    config: {
        service: "Gmail",
        auth: {
            user: "[email protected]",
            pass: "your-app-password",
        },
    },
};

uMailer(mail);

Notes

  • Ensure that the paths to the HTML files are correct.
  • Handle any sensitive information such as email addresses and app passwords securely.
  • The package currently supports only Gmail service.

License

This package is open-source and available under the Apache-2.0 License.

Contact

For issues, questions, or contributions, please visit the GitHub repository or contact the maintainer.