Skip to content

Commit de260b6

Browse files
committed
initial commit 🎉
0 parents  commit de260b6

34 files changed

+22348
-0
lines changed

.gitignore

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Dependencies
2+
/node_modules
3+
4+
# Production
5+
/build
6+
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# Misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
17+
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*

README.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Website
2+
3+
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
4+
5+
### Installation
6+
7+
```
8+
$ yarn
9+
```
10+
11+
### Local Development
12+
13+
```
14+
$ yarn start
15+
```
16+
17+
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
18+
19+
### Build
20+
21+
```
22+
$ yarn build
23+
```
24+
25+
This command generates static content into the `build` directory and can be served using any static contents hosting service.
26+
27+
### Deployment
28+
29+
Using SSH:
30+
31+
```
32+
$ USE_SSH=true yarn deploy
33+
```
34+
35+
Not using SSH:
36+
37+
```
38+
$ GIT_USER=<Your GitHub username> yarn deploy
39+
```
40+
41+
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.

babel.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3+
};

docs/Demo/Example.md

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
Let's see an example
6+
7+
**POST** mail
8+
9+
#### Request URL
10+
11+
```
12+
https://devmailer.vercel.app/api/sendmail?apikey=j2hvs2@sh2872092ue12seQ3
13+
```
14+
15+
#### Response
16+
17+
**Status:** 200 Ok
18+
19+
```json
20+
{
21+
"message": "mail has been sent",
22+
"data": {
23+
"accepted": [
24+
25+
],
26+
"rejected": [],
27+
"envelopeTime": 169,
28+
"messageTime": 370,
29+
"messageSize": 347,
30+
"response": "250 2.0.0 OK 16728293766 a11-20020a05620a16cb00b006bb29d932e1sm221367966qkn.105 - gsmtp",
31+
"envelope": {
32+
"from": "[email protected]",
33+
"to": [
34+
35+
]
36+
},
37+
"messageId": "<[email protected]>"
38+
}
39+
}
40+
```

docs/Demo/_category_.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"label": "👀 Demo",
3+
"position": 3,
4+
"link": {
5+
"type": "generated-index"
6+
}
7+
}

docs/Guide/Authorization.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
sidebar_position: 2
3+
---
4+
5+
#### Public Authorization
6+
7+
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.
8+
9+
To authenticate requests in this way, pass your application’s access key via the query parameter:
10+
11+
```
12+
https://devmailer.vercel.app/api/sendmail?apikey=YOUR_API_KEY
13+
```
14+
15+
## <span>⚠️</span> Note:
16+
Keep your API key with you safely. You can access the API only through API key

docs/Guide/Mail.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
sidebar_position: 4
3+
---
4+
5+
Send mail by providing the required parameters.
6+
7+
## End point
8+
9+
```
10+
https://devmailer.vercel.app/api
11+
```
12+
13+
## Send mail
14+
15+
Send a mail
16+
17+
```Request
18+
POST /sendmail
19+
```
20+
21+
#### Parameters
22+
23+
| param | Description | Required |
24+
| ------- | ------------------- | -------- |
25+
| from | Sender name | true |
26+
| to | Recevier email ID | true |
27+
| subject | Subject of the mail | true |
28+
| message | Body of the mail | true |
29+
30+
31+
## <span>⚠️</span>Note:
32+
Message can be <i><u>html</u></i>

docs/Guide/Rate Limiting.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
sidebar_position: 3
3+
---
4+
5+
You can send 1000 requests per day.

docs/Guide/Schema.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
## Location
6+
7+
You can access API at https://devmailer.vercel.app/api
8+
9+
## Summary objects
10+
11+
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.
12+
13+
## HTTP Verbs
14+
15+
The DevMailer API uses HTTP verbs appropriate to each action.
16+
17+
| Verbs | Description |
18+
| ------ | -------------------- |
19+
| GET | Retrieving resources |
20+
| POST | Creating resources |
21+
| PUT | Updating resources |
22+
| DELETE | Deleting resources |
23+
24+
## Error
25+
26+
If an error occurs, whether on the server or client side, the error message(s) will be returned in as object. For example:
27+
28+
> Status Code: 400
29+
30+
```JSON
31+
{
32+
"message": "from, to, subject, body - these fields are required!",
33+
}
34+
```
35+
36+
| Common Status Codes | Description |
37+
| ------------------- | ----------------------------------------------------------------------- |
38+
| 200 - OK | Everything worked as expected |
39+
| 400 - Bad Request | The request was unacceptable, often due to missing a required parameter |
40+
| 401 - Unauthorized | Invalid Access Token |
41+
| 403 - Forbidden | Missing permissions to perform request |
42+
| 404 - Not Found | The requested resource doesn’t exist |
43+
| 500, 503 | Something went wrong on our end |

docs/Guide/_category_.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"label": "📗 Guide",
3+
"position": 2,
4+
"link": {
5+
"type": "generated-index"
6+
}
7+
}

docs/Integration/_category_.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"label": "⛏️ Integration",
3+
"position": 4,
4+
"link": {
5+
"type": "generated-index"
6+
}
7+
}

docs/Integration/vanilla JS.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
sdibar_position: 1
3+
---
4+
5+
**Integrating Dev Mailer with a simple form in vanilla JS.**
6+
7+
```javascript
8+
const emilForm = document.querySelector('#emailForm')
9+
const API_KEY = YOUR_API_KEY
10+
```
11+
12+
## Create a function that handles and makes a POST request to the api
13+
14+
```javascript
15+
async function handleSubmit(e) {
16+
e.preventDefault()
17+
18+
const form = new FormData(e.target);
19+
const formData = Object.fromEntries(form.entries());
20+
21+
22+
const options = {
23+
method: 'POST',
24+
headers: {
25+
'Content-Type': 'application/json'
26+
},
27+
body: JSON.stringify(formData)
28+
}
29+
30+
const res = await fetch(`https://devmailer.vercel.app/api/sendmail?apikey=${API_KEY}`, options)
31+
32+
const jsonData = await res.json()
33+
console.log(jsonData)
34+
}
35+
```
36+
37+
## Select the form and add an event listener to it
38+
39+
```javascript
40+
emilForm.addEventListener('submit', handleSubmit)
41+
```
42+
43+
**<span>⚠️</span> Note:**
44+
Make sure the input field names match the fields that are required by the API (from, to, subject, body).
45+
46+
> Live Demo: https://replit.com/@SnowinJ/devmailer-example?v=1

docs/img/dashboard-api.png

251 KB
Loading

docs/img/dashboard.png

256 KB
Loading

docs/img/home.png

221 KB
Loading

docs/img/signin.png

147 KB
Loading

docs/intro.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
slug: /
3+
sidebar_position: 1
4+
---
5+
6+
# 🚀 Getting Started
7+
8+
Let's discover about **Dev Mailer in less than 5 minutes**.
9+
10+
## Steps to follow 📖
11+
12+
Let's get started!
13+
14+
### 1. Create a new account
15+
- Go to the <a href="https://devmailer.vercel.app/" target="_blank">DevMailer official site</a>.
16+
17+
- Click on **Get started**
18+
19+
![instruction image](./img/home.png)
20+
21+
### 2. Complete the registration
22+
23+
![instruction image](./img/signin.png)
24+
25+
### 3. You will be redirected to the dashboord
26+
27+
![instruction image](./img/dashboard.png)
28+
29+
### 4. Here you can find your api key
30+
31+
![instruction image](./img/dashboard-api.png)
32+
33+
Store the api key in ``.env`` file safely.
34+
35+
### That's all, You are good to go 🥳 !
36+
37+
> For any help contact: [email protected]

0 commit comments

Comments
 (0)