-
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 #30 from mailsac/services_private_addresses
Services private addresses
- Loading branch information
Showing
8 changed files
with
131 additions
and
3 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
17 changes: 17 additions & 0 deletions
17
services/private_addresses/curl_reserve_private_address.txt
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,17 @@ | ||
curl -X POST -H "Mailsac-Key: YOUR_API_KEY_HERE" https://mailsac.com/api/addresses/unitedmonkey@mailsac.com | ||
|
||
# Output from curl | ||
{ | ||
"_id": "unitedmonkey@mailsac.com", | ||
"catchAll": null, | ||
"created": "2020-07-23T14:49:10.129Z", | ||
"enablews": null, | ||
"forward": null, | ||
"info": "", | ||
"owner": "monkeyman", | ||
"password": null, | ||
"updated": "2020-07-23T14:49:10.129Z", | ||
"webhook": null, | ||
"webhookSlack": null, | ||
"webhookSlackToFrom": null | ||
} |
27 changes: 27 additions & 0 deletions
27
services/private_addresses/nodejs_reserve_private_address.js
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,27 @@ | ||
const superagent = require('superagent') | ||
|
||
superagent | ||
.post('https://mailsac.com/api/addresses/unitedmonkey@mailsac.com') | ||
.set('Mailsac-Key', 'YOUR_API_KEY_HERE') | ||
.then((reservation) => { | ||
console.log(reservation.body) | ||
}) | ||
.catch(err => { | ||
console.log(err.message) | ||
}) | ||
/* | ||
{ | ||
_id: 'unitedmonkey@mailsac.com', | ||
owner: 'monkeyman', | ||
forward: null, | ||
enablews: null, | ||
webhook: null, | ||
webhookSlack: null, | ||
webhookSlackToFrom: null, | ||
catchAll: null, | ||
password: null, | ||
info: '', | ||
created: '2020-07-23T15:00:00.935Z', | ||
updated: '2020-07-23T15:00:00.935Z' | ||
} | ||
*/ |
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,31 @@ | ||
.. _doc_private_addresses: | ||
|
||
.. _sec_private_addresses: | ||
|
||
Private Email Addresses | ||
======================= | ||
|
||
Messages sent to a Private Email Address are only visible by the owner of | ||
the Private Email Address. | ||
|
||
Private Email Addresses have additional features: | ||
|
||
- :ref:`sec_forward_to_another_mailsac_address` | ||
- :ref:`Forward to Slack <doc_slack_webhook>` | ||
- :ref:`sec_webhook_forwarding` | ||
- :ref:`Forward to a Web Socket <doc_websocket_example_overview>` | ||
- `Read / Send Mail using a mail client <https://mailsac.com/docs/fetch-messages-with-pop3>`_ | ||
- `Purge inbox <https://blog.mailsac.com/2020/07/21/easy-purging-of-inboxes/>`_ | ||
|
||
Reserve a Private Address | ||
------------------------- | ||
|
||
.. include:: ./reserve_private_address.rst | ||
|
||
Private Addresses In a Custom Domain | ||
------------------------------------ | ||
|
||
Private Addresses can be used in :ref:`Custom Domains <doc_privatedomains>`. | ||
This allows an address within a :ref:`Custom Domain <doc_privatedomains>` to | ||
have the features of a | ||
:ref:`Private Email Address <sec_private_addresses>`. |
22 changes: 22 additions & 0 deletions
22
services/private_addresses/python_reserve_private_address.py
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,22 @@ | ||
import requests | ||
from pprint import pprint | ||
|
||
headers = {'Mailsac-Key': 'YOUR_API_KEY_HERE'} | ||
url = 'https://mailsac.com/api/addresses/unitedmonkey@mailsac.com' | ||
|
||
r = requests.post(url, headers=headers) | ||
pprint(r.json()) | ||
''' | ||
{'_id': 'unitedmonkey@mailsac.com', | ||
'catchAll': None, | ||
'created': '2020-07-23T15:04:15.981Z', | ||
'enablews': None, | ||
'forward': None, | ||
'info': '', | ||
'owner': 'mjmayer', | ||
'password': None, | ||
'updated': '2020-07-23T15:04:15.981Z', | ||
'webhook': None, | ||
'webhookSlack': None, | ||
'webhookSlackToFrom': None} | ||
''' |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,26 @@ | ||
.. _doc_reserve_private_address: | ||
|
||
.. tabs:: | ||
.. tab:: Mailsac Website | ||
|
||
.. figure:: reserve_private_address.gif | ||
|
||
Reserve private address | ||
|
||
.. tab:: curl | ||
|
||
.. literalinclude:: curl_reserve_private_address.txt | ||
:language: bash | ||
:caption: Reserve Private Address | ||
|
||
.. tab:: Node.js Javascript | ||
|
||
.. literalinclude:: nodejs_reserve_private_address.js | ||
:language: javascript | ||
:caption: Reserve Private Address | ||
|
||
.. tab:: Python | ||
|
||
.. literalinclude:: python_reserve_private_address.py | ||
:language: python | ||
:caption: Reserve Private Address |