diff --git a/package-lock.json b/package-lock.json index d77e5caf..67ca0015 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "@testing-library/user-event": "^13.5.0", "axios": "^0.26.1", "dotenv": "^16.0.3", + "emailjs-com": "^3.2.0", "firebase": "^9.9.4", "react": "^17.0.2", "react-dom": "^17.0.2", @@ -5760,6 +5761,15 @@ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.407.tgz", "integrity": "sha512-5smEvFSFYMv90tICOzRVP7Opp98DAC4KW7RRipg3BuNpGbbV3N+x24Zh3sbLb1T5haGtOSy/hrBfXsWnIM9aCg==" }, + "node_modules/emailjs-com": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/emailjs-com/-/emailjs-com-3.2.0.tgz", + "integrity": "sha512-Prbz3E1usiAwGjMNYRv6EsJ5c373cX7/AGnZQwOfrpNJrygQJ15+E9OOq4pU8yC977Z5xMetRfc3WmDX6RcjAA==", + "deprecated": "The SDK name changed to @emailjs/browser", + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/emittery": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.8.1.tgz", @@ -19141,6 +19151,11 @@ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.407.tgz", "integrity": "sha512-5smEvFSFYMv90tICOzRVP7Opp98DAC4KW7RRipg3BuNpGbbV3N+x24Zh3sbLb1T5haGtOSy/hrBfXsWnIM9aCg==" }, + "emailjs-com": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/emailjs-com/-/emailjs-com-3.2.0.tgz", + "integrity": "sha512-Prbz3E1usiAwGjMNYRv6EsJ5c373cX7/AGnZQwOfrpNJrygQJ15+E9OOq4pU8yC977Z5xMetRfc3WmDX6RcjAA==" + }, "emittery": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.8.1.tgz", diff --git a/package.json b/package.json index 0321bb44..83df04fc 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "@testing-library/user-event": "^13.5.0", "axios": "^0.26.1", "dotenv": "^16.0.3", + "emailjs-com": "^3.2.0", "firebase": "^9.9.4", "react": "^17.0.2", "react-dom": "^17.0.2", diff --git a/src/App.jsx b/src/App.jsx index 5ecff9cc..485e1a2e 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -7,6 +7,7 @@ import Signup from "./components/Signup"; import Profile from "./components/Profile"; import Home from "./pages/Home"; import Movie from "./pages/Movie"; +import Feedback from "./components/Feedback/Feedback"; import Categories from "./pages/Categories"; import { UserAuthContextProvider } from "./context/authContext"; import ProtectedRoute from "./components/ProtectedRoute"; @@ -54,6 +55,15 @@ function App() { } /> + + + + } + /> { + const [email, setEmail] = useState(''); + const [submitted, setSubmitted] = useState(false); + const [feedback, setFeedback] = useState(''); + emailjs.init('1AkXF-PC-6FG2Ym15'); + + const handleSubmit = (e) => { + e.preventDefault(); + + const templateParams = { + feedback: feedback, + to_email: 'harshupadhye2832@gmail.com', + from_email: email + }; + emailjs + .send('service_c8wox7q', 'template_47lh3vm', templateParams, '1AkXF-PC-6FG2Ym15') + .then((response) => { + console.log('Feedback sent!', response.status, response.text); + setSubmitted(true); + setFeedback(''); + setEmail(''); + }) + .catch((error) => { + console.error('Error sending feedback:', error); + }); + }; + + return ( +
+
+