https://github.com/younes-alturkey/form-api
https://github.com/younes-alturkey/form-api
expressjs htmlform nodejs sendgrid
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/younes-alturkey/form-api
- Owner: younes-alturkey
- Created: 2022-03-12T17:48:36.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-07-25T12:37:55.000Z (almost 4 years ago)
- Last Synced: 2025-03-11T08:35:56.632Z (about 1 year ago)
- Topics: expressjs, htmlform, nodejs, sendgrid
- Language: HTML
- Homepage: https://ya-form-api.herokuapp.com
- Size: 38.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# How-To Guide
```bash
git clone https://github.com/younes-alturkey/form-api.git
```
```bash
npm i
```
## How To Run
```bash
npm run start
```
Runs on http://localhost:5000.
## How To Use
IMPORTANT NOTE:
First field or FormData append is reserved for the subject of the email and is excluded from the email body.
Second field or FormData append is reserved for the cc list is excluded from the email body. This has to be a JavaScript array of strings. [""]
```bash
var formdata = new FormData();
formdata.append("subject", "Email Subject: New Form Submitted");
formdata.append("cc", "[\"alturkeyy@gmail.com\", \"hi@younes.ninja\", \"younes@bhr.sa\"]");
formdata.append("name", "Younes Alturkey");
formdata.append("email", "hi@younes.ninja");
formdata.append("phone number", "+966538654514");
var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};
fetch("https://ya-form-api.herokuapp.com/younes@itsnuqtah.com", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
```
Or
```bash
```
Add your fields after these two.
The form supports file upload.