Giter VIP home page Giter VIP logo

fastuptime / mailquick Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 4 KB

πŸ“¬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. πŸš€

Home Page: https://www.npmjs.com/package/mailquick

JavaScript 100.00%
brevo mailersend mailjet postmark sendgrid mailquick

mailquick's Introduction

πŸ“¬ 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.

mailquick's People

Contributors

fastuptime avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.