-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for optional email input field
- Loading branch information
Showing
9 changed files
with
47 additions
and
22 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 |
---|---|---|
@@ -1 +1,2 @@ | ||
node_modules/ | ||
node_modules/ | ||
.vscode/ |
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 |
---|---|---|
|
@@ -80,7 +80,7 @@ You will have to handle the submission on the backend yourself. [feedback-js](ht | |
```json | ||
{ | ||
"id": "example", | ||
"user": "[email protected]", | ||
"email": "[email protected]", | ||
"feedbackType": "issue", | ||
"url": "https://example.com", | ||
"message": "When I click x nothing happens." | ||
|
@@ -95,9 +95,9 @@ const app = express() | |
const port = 3000 | ||
|
||
app.post('/feedback', async (req, res) => { | ||
const { id, feedbackType, message, user, url } = req.body | ||
const { id, feedbackType, message, email, url } = req.body | ||
|
||
console.log(`New ${ feedbackType } feedback for form ${ id } from user ${ user } on page ${ url }: ${ message }`) | ||
console.log(`New ${ feedbackType } feedback for form ${ id } from user ${ email } on page ${ url }: ${ message }`) | ||
// do something with feedback | ||
|
||
res.send('ok') | ||
|
@@ -114,7 +114,7 @@ If you don't want to show the button and send feedback programatically you can u | |
|
||
```javascript | ||
const feedback = new Feedback(options); | ||
feedback.sendFeedback('feedbackType', 'message', 'url'); | ||
feedback.send('feedbackType', 'message', 'url', 'email'); | ||
``` | ||
|
||
## ⚙️ Options | ||
|
@@ -125,7 +125,7 @@ You can customize [feedback-js](https://github.com/BetaHuhn/feedback-js) by pass | |
const options = { | ||
id: 'feedback', // id to identify the form on the backend | ||
endpoint: 'https://example.com/feedback', // enpoint of your backend to handle the submission | ||
user: '[email protected]', // userId in your system, email address or other identifier | ||
emailField: true, // show email input field, default: false | ||
btnTitle: 'Feedback', // title of button | ||
title: 'Company Feedback', // text at the top | ||
contactText: 'Or send an email!', // text for other contact option | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -22,7 +22,7 @@ | |
function addFeedback() { | ||
const options = { | ||
id: 'test', | ||
endpoint: 'http://192.168.44.30:6600/form/feedback', | ||
endpoint: 'http://172.21.52.196:6600/form/feedback', | ||
contactLink: 'mailto:[email protected]?subject=Feedback' | ||
} | ||
|
||
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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