Skip to content

Commit

Permalink
Debugging contact form
Browse files Browse the repository at this point in the history
  • Loading branch information
SnailBones committed Mar 13, 2024
1 parent a881597 commit 84ba733
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
emails.log

# local env files
.env
.env*.local

# vercel
Expand Down
11 changes: 7 additions & 4 deletions app/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ export async function sendEmail(formData: FormData) {
});
const logFilePath = path.join(__dirname, "../../../../emails.log");

console.log("sending email and logging to: ", logFilePath);
console.log("email is", process.env.EMAIL);
console.log("password is", process.env.PASSWORD);

function writeToFile(logMessage: string) {
fs.appendFileSync(logFilePath, logMessage);
}
Expand All @@ -39,6 +35,13 @@ export async function sendEmail(formData: FormData) {
function (error: any, info: { response: string }) {
if (error) {
console.log(error);
writeToFile(
"email is " +
process.env.EMAIL +
" password is" +
process.env.PASSWORD +
"\n"
);
writeToFile(error + "\n\n");
} else {
console.log("Email sent: " + info.response);
Expand Down

0 comments on commit 84ba733

Please sign in to comment.