Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/quavedev/email-postmark
https://github.com/quavedev/email-postmark
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/quavedev/email-postmark
- Owner: quavedev
- Created: 2021-10-01T01:55:45.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-11-08T12:44:27.000Z (about 1 year ago)
- Last Synced: 2023-11-08T13:25:25.395Z (about 1 year ago)
- Language: JavaScript
- Size: 11.7 KB
- Stars: 1
- Watchers: 0
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# quave:email-postmark
### MIGRATED TO https://github.com/quavedev/meteor-packages/tree/main/email-postmark
`quave:email-postmark` is a Meteor package that provides a plug-and-play integration with [Postmark](https://postmarkapp.com/).
## Why
It is designed to simplify the process of sending emails with Meteor.
We are using the `email` package from Meteor.
We believe we are not reinventing the wheel in this package but what we are doing is like putting together the wheels in the vehicle :).
## Installation
```sh
meteor add quave:email-postmark
```## Usage
### Configuration
You just need to configure your authentication data in the settings if you just want to use Postmark as provider for Meteor emails.
```json
{
"packages": {
"quave:email-postmark": {
"from": "[email protected]",
"apiToken": "tttttttt-1111-2222-3333-tttttttttttt"
}
}
}
```Or you need to set the `from` here in the settings or you need to always call the email manually and inform the from in the props.
### Code usage
If you want to use our code to send emails directly you can also call like below:
```javascript
import { sendEmail } from 'meteor/quave:email-postmark';Meteor.methods({
newEmail({ to, subject, content }) {
sendEmail({
to,
subject,
content,
})
.then(() => {
console.log(`Email sent to ${to}`);
})
.catch(error => {
console.error(`Error sending email to ${to}`, error);
});
}
});
```You can provide the `from` as well in the `sendEmail` function.
## Limitations
Meteor `email` package needs to be in the version 2.2 or above. This corresponds to Meteor version 2.4.
### License
MIT