From 7e543aebc0a6ead3f3d866f02c25568c3e22d562 Mon Sep 17 00:00:00 2001 From: Mikayla Dobson Date: Mon, 27 May 2024 17:37:24 +0000 Subject: [PATCH] tweak to working details --- app/contact/page.tsx | 3 ++- components/Navbar/index.tsx | 7 ++----- components/Resume/Experience.tsx | 2 +- env.mjs | 13 ++++++++++++- next.config.js | 3 +++ server/actions/contact.actions.ts | 28 +++++++++++++++++----------- 6 files changed, 37 insertions(+), 19 deletions(-) diff --git a/app/contact/page.tsx b/app/contact/page.tsx index b77ff07..b45e3b9 100644 --- a/app/contact/page.tsx +++ b/app/contact/page.tsx @@ -1,4 +1,5 @@ 'use client'; +import { submitMessage } from "@/server/actions/contact.actions"; import { useMemo, useState } from "react"; export default function ContactPage() { @@ -15,7 +16,7 @@ export default function ContactPage() {

Thanks for your interest! I'm looking forward to hearing from you.

-
+ await submitMessage({ from: email, text: message })}>
diff --git a/components/Navbar/index.tsx b/components/Navbar/index.tsx index 2fed560..1189fd4 100644 --- a/components/Navbar/index.tsx +++ b/components/Navbar/index.tsx @@ -37,9 +37,6 @@ export default function Navbar() {
- - -
@@ -60,8 +57,8 @@ export default function Navbar() {

About

- setMobileMenuOpen(false)} passHref href="/projects" className="w-auto px-2"> -

Projects

+ setMobileMenuOpen(false)} passHref href="/links" className="w-auto px-2"> +

Links

setMobileMenuOpen(false)} passHref href="/contact" className="w-auto px-2"> diff --git a/components/Resume/Experience.tsx b/components/Resume/Experience.tsx index 55b5a6c..249ff74 100644 --- a/components/Resume/Experience.tsx +++ b/components/Resume/Experience.tsx @@ -11,7 +11,7 @@ export default function Experience() {
-

Building a dedicated tool for sound design professionals to browse, stream, and download from a large library of audio assets in an on-premise managed cloud solution.

+

Contributing as part of a development team building an insurance tech solution.

diff --git a/env.mjs b/env.mjs index b29626a..dfa965e 100644 --- a/env.mjs +++ b/env.mjs @@ -2,7 +2,18 @@ import { createEnv } from "@t3-oss/env-nextjs"; import { z } from 'zod'; const env = createEnv({ - + server: { + SMTP_USER: z.string().optional(), + SMTP_PASS: z.string().optional(), + SMTP_TO: z.string().optional(), + SMTP_HOST: z.string().optional(), + }, + runtimeEnv: { + SMTP_USER: process.env.SMTP_USER, + SMTP_PASS: process.env.SMTP_PASS, + SMTP_TO: process.env.SMTP_TO, + SMTP_HOST: process.env.SMTP_HOST, + }, }) export { env } diff --git a/next.config.js b/next.config.js index fae793b..2dc614b 100644 --- a/next.config.js +++ b/next.config.js @@ -2,6 +2,9 @@ const nextConfig = { pageExtensions: ['js', 'jsx', 'ts', 'tsx'], reactStrictMode: true, + experimental: { + serverActions: true, + } } module.exports = nextConfig; diff --git a/server/actions/contact.actions.ts b/server/actions/contact.actions.ts index f1a453b..f73f3e1 100644 --- a/server/actions/contact.actions.ts +++ b/server/actions/contact.actions.ts @@ -1,26 +1,32 @@ 'use server'; import { createTransport } from "nodemailer"; import SMTPTransport from "nodemailer/lib/smtp-transport"; +import { env } from "../../env.mjs" export async function submitMessage({ from, text }: { from: string, text: string }) { - // const transport = createTransport({ - // host: "unknown", - // port: 0, - // auth: { - // user: env.SMTP_USER, - // pass: "" - // }, + const options = { + host: env.SMTP_HOST, + port: 587, + auth: { + user: env.SMTP_USER, + pass: env.SMTP_PASS, + }, + } as SMTPTransport.Options; + + // console.log({ options }); + + // const transport = createTransport(options); + + // const result = await transport.sendMail({ // subject: "Contact Form Submission | mikayla.dev", - // to: env.SMTP_USER, + // to: env.SMTP_TO, // from, // text, - // } as SMTPTransport.Options); + // }); - // const result = await transport.sendMail(sendMailOptions) // const failed = result.rejected.concat(result.pending).filter(Boolean); // if (failed.length) { // throw new Error("Failed to send email verification"); // } - }