-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit de260b6
Showing
34 changed files
with
22,348 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Dependencies | ||
/node_modules | ||
|
||
# Production | ||
/build | ||
|
||
# Generated files | ||
.docusaurus | ||
.cache-loader | ||
|
||
# Misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
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,41 @@ | ||
# Website | ||
|
||
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator. | ||
|
||
### Installation | ||
|
||
``` | ||
$ yarn | ||
``` | ||
|
||
### Local Development | ||
|
||
``` | ||
$ yarn start | ||
``` | ||
|
||
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. | ||
|
||
### Build | ||
|
||
``` | ||
$ yarn build | ||
``` | ||
|
||
This command generates static content into the `build` directory and can be served using any static contents hosting service. | ||
|
||
### Deployment | ||
|
||
Using SSH: | ||
|
||
``` | ||
$ USE_SSH=true yarn deploy | ||
``` | ||
|
||
Not using SSH: | ||
|
||
``` | ||
$ GIT_USER=<Your GitHub username> yarn deploy | ||
``` | ||
|
||
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. |
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,3 @@ | ||
module.exports = { | ||
presets: [require.resolve('@docusaurus/core/lib/babel/preset')], | ||
}; |
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,40 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
|
||
Let's see an example | ||
|
||
**POST** mail | ||
|
||
#### Request URL | ||
|
||
``` | ||
https://devmailer.vercel.app/api/sendmail?apikey=j2hvs2@sh2872092ue12seQ3 | ||
``` | ||
|
||
#### Response | ||
|
||
**Status:** 200 Ok | ||
|
||
```json | ||
{ | ||
"message": "mail has been sent", | ||
"data": { | ||
"accepted": [ | ||
"user@test.com" | ||
], | ||
"rejected": [], | ||
"envelopeTime": 169, | ||
"messageTime": 370, | ||
"messageSize": 347, | ||
"response": "250 2.0.0 OK 16728293766 a11-20020a05620a16cb00b006bb29d932e1sm221367966qkn.105 - gsmtp", | ||
"envelope": { | ||
"from": "service.devmailer@gmail.com", | ||
"to": [ | ||
"user@test.com" | ||
] | ||
}, | ||
"messageId": "<d82a679b-c26f-a5c6-5acf-20f9381301b5d@test.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,7 @@ | ||
{ | ||
"label": "👀 Demo", | ||
"position": 3, | ||
"link": { | ||
"type": "generated-index" | ||
} | ||
} |
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,16 @@ | ||
--- | ||
sidebar_position: 2 | ||
--- | ||
|
||
#### Public Authorization | ||
|
||
Most actions can be performed without requiring authentication from a specific user. For example, fetching, or sending a mail does not require a user to log in. | ||
|
||
To authenticate requests in this way, pass your application’s access key via the query parameter: | ||
|
||
``` | ||
https://devmailer.vercel.app/api/sendmail?apikey=YOUR_API_KEY | ||
``` | ||
|
||
## <span>⚠️</span> Note: | ||
Keep your API key with you safely. You can access the API only through API key |
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,32 @@ | ||
--- | ||
sidebar_position: 4 | ||
--- | ||
|
||
Send mail by providing the required parameters. | ||
|
||
## End point | ||
|
||
``` | ||
https://devmailer.vercel.app/api | ||
``` | ||
|
||
## Send mail | ||
|
||
Send a mail | ||
|
||
```Request | ||
POST /sendmail | ||
``` | ||
|
||
#### Parameters | ||
|
||
| param | Description | Required | | ||
| ------- | ------------------- | -------- | | ||
| from | Sender name | true | | ||
| to | Recevier email ID | true | | ||
| subject | Subject of the mail | true | | ||
| message | Body of the mail | true | | ||
|
||
|
||
## <span>⚠️</span>Note: | ||
Message can be <i><u>html</u></i> |
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,5 @@ | ||
--- | ||
sidebar_position: 3 | ||
--- | ||
|
||
You can send 1000 requests per day. |
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,43 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
|
||
## Location | ||
|
||
You can access API at https://devmailer.vercel.app/api | ||
|
||
## Summary objects | ||
|
||
When retrieving a list of objects, an abbreviated or summary version of that object is returned - i.e., a subset of its attributes. To get a full detailed version of that object, fetch it individually. | ||
|
||
## HTTP Verbs | ||
|
||
The DevMailer API uses HTTP verbs appropriate to each action. | ||
|
||
| Verbs | Description | | ||
| ------ | -------------------- | | ||
| GET | Retrieving resources | | ||
| POST | Creating resources | | ||
| PUT | Updating resources | | ||
| DELETE | Deleting resources | | ||
|
||
## Error | ||
|
||
If an error occurs, whether on the server or client side, the error message(s) will be returned in as object. For example: | ||
|
||
> Status Code: 400 | ||
```JSON | ||
{ | ||
"message": "from, to, subject, body - these fields are required!", | ||
} | ||
``` | ||
|
||
| Common Status Codes | Description | | ||
| ------------------- | ----------------------------------------------------------------------- | | ||
| 200 - OK | Everything worked as expected | | ||
| 400 - Bad Request | The request was unacceptable, often due to missing a required parameter | | ||
| 401 - Unauthorized | Invalid Access Token | | ||
| 403 - Forbidden | Missing permissions to perform request | | ||
| 404 - Not Found | The requested resource doesn’t exist | | ||
| 500, 503 | Something went wrong on our end | |
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,7 @@ | ||
{ | ||
"label": "📗 Guide", | ||
"position": 2, | ||
"link": { | ||
"type": "generated-index" | ||
} | ||
} |
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,7 @@ | ||
{ | ||
"label": "⛏️ Integration", | ||
"position": 4, | ||
"link": { | ||
"type": "generated-index" | ||
} | ||
} |
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,46 @@ | ||
--- | ||
sdibar_position: 1 | ||
--- | ||
|
||
**Integrating Dev Mailer with a simple form in vanilla JS.** | ||
|
||
```javascript | ||
const emilForm = document.querySelector('#emailForm') | ||
const API_KEY = YOUR_API_KEY | ||
``` | ||
|
||
## Create a function that handles and makes a POST request to the api | ||
|
||
```javascript | ||
async function handleSubmit(e) { | ||
e.preventDefault() | ||
|
||
const form = new FormData(e.target); | ||
const formData = Object.fromEntries(form.entries()); | ||
|
||
|
||
const options = { | ||
method: 'POST', | ||
headers: { | ||
'Content-Type': 'application/json' | ||
}, | ||
body: JSON.stringify(formData) | ||
} | ||
|
||
const res = await fetch(`https://devmailer.vercel.app/api/sendmail?apikey=${API_KEY}`, options) | ||
|
||
const jsonData = await res.json() | ||
console.log(jsonData) | ||
} | ||
``` | ||
|
||
## Select the form and add an event listener to it | ||
|
||
```javascript | ||
emilForm.addEventListener('submit', handleSubmit) | ||
``` | ||
|
||
**<span>⚠️</span> Note:** | ||
Make sure the input field names match the fields that are required by the API (from, to, subject, body). | ||
|
||
> Live Demo: https://replit.com/@SnowinJ/devmailer-example?v=1 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
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,37 @@ | ||
--- | ||
slug: / | ||
sidebar_position: 1 | ||
--- | ||
|
||
# 🚀 Getting Started | ||
|
||
Let's discover about **Dev Mailer in less than 5 minutes**. | ||
|
||
## Steps to follow 📖 | ||
|
||
Let's get started! | ||
|
||
### 1. Create a new account | ||
- Go to the <a href="https://devmailer.vercel.app/" target="_blank">DevMailer official site</a>. | ||
|
||
- Click on **Get started** | ||
|
||
![instruction image](./img/home.png) | ||
|
||
### 2. Complete the registration | ||
|
||
![instruction image](./img/signin.png) | ||
|
||
### 3. You will be redirected to the dashboord | ||
|
||
![instruction image](./img/dashboard.png) | ||
|
||
### 4. Here you can find your api key | ||
|
||
![instruction image](./img/dashboard-api.png) | ||
|
||
Store the api key in ``.env`` file safely. | ||
|
||
### That's all, You are good to go 🥳 ! | ||
|
||
> For any help contact: hello.devmailer@gmail.com |
Oops, something went wrong.