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

mailquick

v1.0.0

Published

A Node.js library for sending E-Mail through multiple providers.

Downloads

10

Readme

📬 mailQuick

mailQuick is a versatile email sending module for Node.js that supports multiple email service providers. Whether you use MailerSend, SendGrid, Mailjet, Brevo, or Postmark, mailQuick simplifies sending emails through a unified interface. 🚀

🔧 Installation

To get started with mailQuick, you need to install it via npm:

npm install mailquick

🛠️ Configuration

To use mailQuick, you'll need to initialize it with your email service provider's credentials. Here's a brief guide on how to configure each supported provider:

📧 Supported Providers

  • MailerSend
  • SendGrid
  • Mailjet
  • Brevo
  • Postmark

📜 Example Configuration

Here's how you can set up mailQuick for different providers:

const mailQuick = require('mailquick');

// Initialize with provider and credentials
const mailer = mailQuick.init({
    provider: 'sendgrid',
    apiKey: 'your-sendgrid-api-key',
    from: '[email protected]',
    fromName: 'Your Name'
});

// Send an email
mailer.send({
    to: '[email protected]',
    subject: 'Hello World',
    html: '<p>This is a test email sent using mailQuick!</p>'
}).then(response => {
    console.log(response); // { status: true, message: 'Mail sent' }
}).catch(error => {
    console.error(error); // { status: false, message: 'Mail not sent' }
});

🛠️ Provider-Specific Setup

MailerSend

const mailer = mailQuick.init({
    provider: 'mailersend',
    apiKey: 'your-mailersend-api-key',
    from: '[email protected]',
    fromName: 'Your Name'
});

SendGrid

const mailer = mailQuick.init({
    provider: 'sendgrid',
    apiKey: 'your-sendgrid-api-key',
    from: '[email protected]',
    fromName: 'Your Name'
});

Mailjet

const mailer = mailQuick.init({
    provider: 'mailjet',
    apiKey: 'your-mailjet-api-key',
    apiSecret: 'your-mailjet-api-secret',
    from: '[email protected]',
    fromName: 'Your Name'
});

Brevo

const mailer = mailQuick.init({
    provider: 'brevo',
    apiKey: 'your-brevo-api-key',
    from: '[email protected]',
    fromName: 'Your Name'
});

Postmark

const mailer = mailQuick.init({
    provider: 'postmark',
    apiKey: 'your-postmark-api-key',
    from: '[email protected]',
    fromName: 'Your Name'
});

🌐 Usage

Use the send method to dispatch an email. The required parameters are:

  • to - Recipient email address.
  • subject - Email subject.
  • html - Email body in HTML format.

Example:

mailer.send({
    to: '[email protected]',
    subject: 'Welcome!',
    html: '<p>Thanks for signing up with mailQuick!</p>'
}).then(response => {
    console.log(response); // { status: true, message: 'Mail sent' }
}).catch(error => {
    console.error(error); // { status: false, message: 'Mail not sent' }
});

🛡️ Error Handling

If something goes wrong, mailQuick will return an object with status: false and a corresponding error message. Always handle these responses to ensure proper error management.

💬 Contributing

We welcome contributions to mailQuick! If you have suggestions, bug fixes, or improvements, please submit a pull request or open an issue on our GitHub repository.

📝 License

mailQuick is licensed under the MIT License. See LICENSE for more details.

👋 Acknowledgments

Special thanks to the maintainers and contributors of the email service providers' APIs for making this package possible.