An open API service indexing awesome lists of open source software.

https://github.com/fastuptime/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. ๐Ÿš€
https://github.com/fastuptime/mailquick

brevo mailersend mailjet mailquick postmark sendgrid

Last synced: 4 months ago
JSON representation

๐Ÿ“ฌ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. ๐Ÿš€

Awesome Lists containing this project

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:

```bash
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:

```javascript
const mailQuick = require('mailquick');

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

// Send an email
mailQuick.send({
to: '[email protected]',
subject: 'Hello World',
html: '

This is a test email sent using mailQuick!

'
}).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

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

#### SendGrid

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

#### Mailjet

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

#### Brevo

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

#### Postmark

```javascript
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:

```javascript
mailQuick.send({
to: '[email protected]',
subject: 'Welcome!',
html: '

Thanks for signing up with mailQuick!

'
}).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](https://github.com/fastuptime/mailQuick).

## ๐Ÿ“ License

`mailQuick` is licensed under the MIT License. See [LICENSE](LICENSE) for more details.

## ๐Ÿ‘‹ Acknowledgments

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