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: about 1 year 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. ๐
- Host: GitHub
- URL: https://github.com/fastuptime/mailquick
- Owner: fastuptime
- Created: 2024-09-09T20:57:58.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-16T21:52:24.000Z (over 1 year ago)
- Last Synced: 2024-11-16T22:28:34.724Z (over 1 year ago)
- Topics: brevo, mailersend, mailjet, mailquick, postmark, sendgrid
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/mailquick
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
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: 'your-email@example.com',
fromName: 'Your Name'
});
// Send an email
mailQuick.send({
to: 'recipient@example.com',
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: 'your-email@example.com',
fromName: 'Your Name'
});
```
#### SendGrid
```javascript
mailQuick.init({
provider: 'sendgrid',
apiKey: 'your-sendgrid-api-key',
from: 'your-email@example.com',
fromName: 'Your Name'
});
```
#### Mailjet
```javascript
mailQuick.init({
provider: 'mailjet',
apiKey: 'your-mailjet-api-key',
apiSecret: 'your-mailjet-api-secret',
from: 'your-email@example.com',
fromName: 'Your Name'
});
```
#### Brevo
```javascript
mailQuick.init({
provider: 'brevo',
apiKey: 'your-brevo-api-key',
from: 'your-email@example.com',
fromName: 'Your Name'
});
```
#### Postmark
```javascript
mailQuick.init({
provider: 'postmark',
apiKey: 'your-postmark-api-key',
from: 'your-email@example.com',
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: 'recipient@example.com',
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.