aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormfoiani <mfoiani@mfoi.dev>2026-01-23 01:10:07 -0500
committermfoiani <mfoiani@mfoi.dev>2026-01-23 01:10:07 -0500
commita3fa7f1c401616ae706372887e0e7222919c69eb (patch)
tree195cd3485789751346a2b93eb9dfcf5764baf6ba /src
parent816e9f094d9f4268b7f4cb76dd589f4e4ac8a4fb (diff)
update email logic for prod
Diffstat (limited to 'src')
-rw-r--r--src/app/api/route.ts3
-rw-r--r--src/app/get-started/actions.ts14
-rw-r--r--src/app/get-started/page.tsx1
3 files changed, 7 insertions, 11 deletions
diff --git a/src/app/api/route.ts b/src/app/api/route.ts
deleted file mode 100644
index fd88fde..0000000
--- a/src/app/api/route.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export async function GET(request: Request) {
- return new Response("Hello, this is the API route!");
-}
diff --git a/src/app/get-started/actions.ts b/src/app/get-started/actions.ts
index 1e5f439..e679d91 100644
--- a/src/app/get-started/actions.ts
+++ b/src/app/get-started/actions.ts
@@ -2,7 +2,7 @@
import { createTransport } from "nodemailer";
-const noSend = true; // for testing
+const noSend = false; // for testing
if (noSend) {
console.log("Emails are disabled - no emails will be sent");
@@ -10,10 +10,10 @@ if (noSend) {
export default async function logFormData(
prevState: { message: string; error: boolean },
- formData: FormData
+ formData: FormData,
) {
- // wait 15 sec
- await new Promise<void>((resolve) => setTimeout(resolve, 2000));
+ // wait 2 sec for debug
+ // await new Promise<void>((resolve) => setTimeout(resolve, 2000));
// Create a test account or replace with real credentials.
const transporter = createTransport({
@@ -21,8 +21,8 @@ export default async function logFormData(
port: 465,
secure: true, // true for 465, false for other ports
auth: {
- user: "test@mfoi.dev",
- pass: "Fakrum-5hapzo-fivkeb", // TODO: put in env variable
+ user: process.env.EMAIL_USERNAME,
+ pass: process.env.EMAIL_PASSWORD,
},
});
@@ -54,7 +54,7 @@ export default async function logFormData(
try {
const info = await transporter.sendMail({
from: '"sensiblescholars.com" <test@mfoi.dev>',
- to: "test@mfoi.dev",
+ to: "mfoiani@mfoi.dev",
subject: `New Consultation Request from ${full_name}!`,
html: email_content,
});
diff --git a/src/app/get-started/page.tsx b/src/app/get-started/page.tsx
index 32d7e7a..0f7ce00 100644
--- a/src/app/get-started/page.tsx
+++ b/src/app/get-started/page.tsx
@@ -26,7 +26,6 @@ const initialState = {
};
export default function Home() {
- // TODO: look up webdevsimplified video on forms in nextjs
const [state, formAction, pending] = useActionState(
logFormData,
initialState,