-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from mailsac/update_sending_mail_service
Update sending mail documentation.
- Loading branch information
Showing
8 changed files
with
100 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const superagent = require('superagent') | ||
|
||
superagent | ||
.post('https://mailsac.com/api/outgoing-messages') | ||
.set('Mailsac-Key', 'YOUR_API_KEY_HERE') | ||
.send({ | ||
to: "myfriend@mailsac.com", | ||
from: "user1@mailsac.com", | ||
subject: "Hello Myfriend", | ||
text: "test message from mailsac" | ||
}) | ||
.then((res) => { | ||
console.log(res.body) | ||
}) | ||
.catch(err => { | ||
console.log(err.message) | ||
}) | ||
|
||
/* | ||
{ | ||
from: 'user1@mailsac.com', | ||
to: [ 'myfriend@mailsac.com' ], | ||
id: 'fe-ipic46bqge8' | ||
} | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import requests | ||
from pprint import pprint | ||
|
||
headers = {'Mailsac-Key': 'YOUR_API_KEY_HERE'} | ||
url = 'https://mailsac.com/api/outgoing-messages' | ||
mail = { 'to':'myfriend@mailsac.com', | ||
'from':'user1@mailsac.com', | ||
'subject':'Hello Myfriend', | ||
'text': 'mailsac allows for sending of email' | ||
} | ||
|
||
r = requests.post(url, data=mail, headers=headers) | ||
pprint(r.json()) | ||
''' | ||
{'from': 'user1@mailsac.com', | ||
'id': 'fe-tgitrk8dbga', | ||
'to': ['myfriend@mailsac.com']} | ||
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
curl -H "Mailsac-Key: YOUR_API_KEY_HERE" -X POST \ | ||
https://mailsac.com/api/outgoing-messages \ | ||
-H "Content-Type: application/json" --data '{ "to":"myfriend@mailsac.com", "from": "user1@mailsac.com", "subject": "Hello Myfriend", "text": "test message from mailsac" }' | ||
|
||
# Response | ||
{ | ||
"from": "user1@mailsac.com", | ||
"to": [ | ||
"myfriend@mailsac.com" | ||
], | ||
"id": "fe-3hl55xcrzgr" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.