https://github.com/eyedea-io/syncano-socket-mailgun
Syncano Socket for Mailgun
https://github.com/eyedea-io/syncano-socket-mailgun
mail mailbox mailgun serverless syncano syncano-socket
Last synced: 10 months ago
JSON representation
Syncano Socket for Mailgun
- Host: GitHub
- URL: https://github.com/eyedea-io/syncano-socket-mailgun
- Owner: eyedea-io
- License: mit
- Created: 2017-06-15T17:29:00.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-02-02T18:21:01.000Z (almost 2 years ago)
- Last Synced: 2024-04-13T19:25:06.660Z (almost 2 years ago)
- Topics: mail, mailbox, mailgun, serverless, syncano, syncano-socket
- Language: TypeScript
- Homepage: https://syncano.io
- Size: 232 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 32
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Syncano Socket for Mailgun
[](https://syncano.io)
[](https://circleci.com/gh/eyedea-io/syncano-socket-mailgun/tree/master)

[](https://standardjs.com)
[](https://www.npmjs.com/package/@eyedea-sockets/)

Main Socket features:
* **mailgun/send** — send e-mail
* **mailgun/webhook** — webhook for receiving e-mails via Mailgun
## Getting Started
Install package in your project:
```sh
cd my_project
npm install @syncano/cli --save-dev
npm install @eyedea-sockets/mailgun --save
npx s deploy
```
Use it:
```js
import Syncano from '@syncano/client'
const s = new Syncano()
// E-mail params
const params = {
to: 'john.doe@example.com'
from: 'App admin '
subject: 'My awesome subject'
html: '
Email title
Hello
'
}
const sendStatus = await s.post('mailgun/send', params)
```
## Endpoints
### mailgun/send
#### Input:
| Parameter | Type | Description | Example |
|-----------|--------|----------------------|------------------------------------|
| to | string | Message recipient | `john.doe@example.com` |
| from | string | Message sender | `App admin ` |
| subject | string | Message subject | `My awesome subject` |
| html | string | Message body in HTML | `
Email title
Hello
` |
#### Outputs:
**success** - **Operation Successful**
- Code: 200
- Mimetype: application/json
| Parameter | Type | Description | Example |
|-----------|--------|--------------------|----------------------|
| message | string | Success message | `Message sent.` |
**fail** - **Operation failed**
- Code: 400
- Mimetype: application/json
| Parameter | Type | Description | Example |
|-----------|--------|------------------------|----------------------|
| message | string | Invitation failed | `Internal error.` |
### mailgun/webhook
#### Input:
Mailgun E-mail message payload. For more info check section "Parsed Messages Parameters" of Mailgun docs:
https://documentation.mailgun.com/en/latest/user_manual.html#receiving-forwarding-and-storing-messages
#### Outputs:
**success** - **Operation Successful**
- Code: 204
- Mimetype: application/json
**fail** - **Operation failed**
- Code: 400
- Mimetype: application/json
| Parameter | Type | Description | Example |
|-----------|--------|------------------------|-------------------|
| message | string | Operation failed | `Internal error.` |