Skip to content

Commit

Permalink
Merge pull request #77 from hlabella/pr_attempt
Browse files Browse the repository at this point in the history
Added instructions to modify contact form
  • Loading branch information
issaafalkattan committed Dec 18, 2023
2 parents f1e5852 + a84168e commit 25b0a54
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -22,7 +22,7 @@ After cloning the files, you will have to run ```yarn``` followed by ```yarn sta
### 3. Add your own data
Change the data in the ```data.json``` file as well as add any images to ```public/img/```
You can also change styles by modifying the ```public/css``` files.

If you need the contact form to work, you also need to create an EmailJS account, and modify the ```src/components/contact.jsx``` file to replace your own service ID, template ID and Public Key

## Like this project?
<a href="https://www.buymeacoffee.com/issaaf">Buy my a coffee ☕️</a>
Expand Down
8 changes: 6 additions & 2 deletions src/components/contact.jsx
Expand Up @@ -15,12 +15,16 @@ export const Contact = (props) => {
setState((prevState) => ({ ...prevState, [name]: value }));
};
const clearState = () => setState({ ...initialState });



const handleSubmit = (e) => {
e.preventDefault();
console.log(name, email, message);

{/* replace below with your own Service ID, Template ID and Public Key from your EmailJS account */ }

emailjs
.sendForm("YOUR_SERVICE_ID", "YOUR_TEMPLATE_ID", e.target, "YOUR_USER_ID")
.sendForm("YOUR_SERVICE_ID", "YOUR_TEMPLATE_ID", e.target, "YOUR_PUBLIC_KEY")
.then(
(result) => {
console.log(result.text);
Expand Down

2 comments on commit 25b0a54

@vercel
Copy link

@vercel vercel bot commented on 25b0a54 Dec 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 25b0a54 Dec 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.