-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit 549147a Author: Deveesh Shetty <[email protected]> Date: Fri Mar 24 13:21:53 2023 +0530 It works in production 🥳🥳🥳🥳🥳 commit ea28598 Author: Deveesh Shetty <[email protected]> Date: Fri Mar 24 13:09:50 2023 +0530 IDK whats happening.......i am losing my mind now commit 8b737ac Author: Deveesh Shetty <[email protected]> Date: Fri Mar 24 12:45:10 2023 +0530 Revert "Attempt 6....tired ://///" This reverts commit 1956bdb. commit e1bc202 Author: Deveesh Shetty <[email protected]> Date: Fri Mar 24 12:31:46 2023 +0530 Using nodemailer again with app password... Working in development commit 1956bdb Author: Deveesh Shetty <[email protected]> Date: Fri Mar 24 11:07:56 2023 +0530 Attempt 6....tired :///// commit 3e96b60 Author: Deveesh Shetty <[email protected]> Date: Fri Mar 24 11:00:15 2023 +0530 Checking in production attempt 5 commit dbaafe7 Author: Deveesh Shetty <[email protected]> Date: Fri Mar 24 10:46:15 2023 +0530 Attempt 4 :`) commit 4798891 Author: Deveesh Shetty <[email protected]> Date: Fri Mar 24 10:35:15 2023 +0530 Attempt to make it work in production commit b2c13a6 Author: Deveesh Shetty <[email protected]> Date: Fri Mar 24 10:21:43 2023 +0530 Works without nodemailer!!! in development.. Time to check in production commit efbc7d4 Author: Deveesh Shetty <[email protected]> Date: Fri Mar 24 09:03:02 2023 +0530 Another attempt please work commit 03c5cdd Author: Deveesh Shetty <[email protected]> Date: Fri Mar 24 08:56:00 2023 +0530 Attempt to fix the mail in production commit 68cdbc5 Author: Deveesh Shetty <[email protected]> Date: Fri Mar 24 08:43:38 2023 +0530 Testing for mail to work in production commit 29d031e Author: Deveesh Shetty <[email protected]> Date: Fri Mar 24 08:33:13 2023 +0530 Minor UX changes
- Loading branch information
1 parent
a7292bc
commit 6ea538b
Showing
5 changed files
with
5,442 additions
and
170 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,7 +1,4 @@ | ||
EMAIL = "<Email ID registered with google cloud console>" | ||
EMAIL = "email id of sender" | ||
|
||
CLIENT_ID = "your_client_ID" | ||
CLIENT_SECRET = "your_client_secret" | ||
|
||
REFRESH_TOKEN = "refresh_token" | ||
ACCESS_TOKEN = "access_token" | ||
RECEIPIENT_EMAIL = "email id of receiver" | ||
PASSWORD = "app password generated by EMAIL" |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { FormEvent, useState, ChangeEvent } from "react" | ||
import axios from "axios" | ||
import { ToastContainer, toast } from "react-toastify" | ||
import { toast } from "react-toastify" | ||
import Loading from "@/components/UIComponents/Loading/Loading" | ||
import styles from "./ContactForm.module.css" | ||
|
||
|
@@ -15,10 +15,29 @@ function ContactForm() { | |
|
||
async function handleFormSubmit(e: FormEvent) { | ||
e.preventDefault() | ||
setLoading(true) | ||
if (!details.email || !details.name) return | ||
if (!details.email || !details.name) { | ||
toast.error("Fill the email and name fields", { | ||
position: "bottom-right", | ||
autoClose: 3000, | ||
hideProgressBar: false, | ||
closeOnClick: true, | ||
pauseOnHover: true, | ||
draggable: true, | ||
progress: undefined, | ||
theme: "light", | ||
}) | ||
return | ||
} | ||
|
||
try { | ||
const response = await axios.post("/api/mail", details) | ||
setLoading(true) | ||
const response = await axios("/api/mail", { | ||
method: "POST", | ||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
data: details, | ||
}) | ||
|
||
if (response.status === 200) { | ||
console.log(response.data) | ||
|
@@ -66,7 +85,6 @@ function ContactForm() { | |
onChange={onChange} | ||
placeholder="[email protected]" | ||
value={details.email} | ||
required | ||
/> | ||
</div> | ||
<div> | ||
|
@@ -78,7 +96,6 @@ function ContactForm() { | |
onChange={onChange} | ||
placeholder="Developer X" | ||
value={details.name} | ||
required | ||
/> | ||
</div> | ||
<div> | ||
|
@@ -93,7 +110,7 @@ function ContactForm() { | |
></textarea> | ||
</div> | ||
<div> | ||
<button type="submit"> | ||
<button type="submit" disabled={loading}> | ||
<div>{loading ? <Loading /> : "Send"}</div> | ||
</button> | ||
</div> | ||
|
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
Oops, something went wrong.
6ea538b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
deveesh – ./
deveesh-git-main-deveesh-shetty.vercel.app
deveesh-deveesh-shetty.vercel.app
deveesh.vercel.app