I was working on a personal project for the past week and have been testing it locally using Netlify Dev. Now that it was all working, I started testing it in production, but seems like it’s not working as expected for one thing.
To provide some context, I was trying to develop my own static comments solution powered by Netlify Functions. I have added a feature where we could reply to existing comments and the creator of the original comment would be notified by email (if they had provided one while submitting the comment). I’m storing the database on FaunaDB and sending out the emails using Nodemailer and Sendinblue SMTP.
As I have said before, the local tests worked fine, I was receiving emails, the production one however, doesn’t seem to work. What’s strange to me that, it seems as if the Nodemailer is not even trying to send e-mail because in my Sendinblue dashboard, I don’t see any email being sent out (as opposed to my local tests in which I could not only see the email being sent, but also delivered and email opens were tracked too).
My Functions log returns no error, so I’m not sure what’s happening.
Here’s my repo if someone wants to test: https://github.com/Hrishikesh-K/Comments
You’d need some environment variables to test and since I can’t expect anyone to have or create accounts on FaunaDB and Sendinblue to help me, I’m giving out access to test keys which I will delete once the thread is solved.
FAUNADB = fnAEHKkAkmACBfKxAaCfhuNxH8UJg-2OI_NUIJe_ SENDINBLUE_USER = firstname.lastname@example.org SENDINBLUE_PASS = xsmtpsib-42e7ae48396b5f44d1637ea22ef603690a800a62f5b0d0972530f6e1d795c6cb-ND8tXMpsCHxyOKq1 SENDINBLUE_SENDER = "Foo Bar <email@example.com>"
Save the above text in a
.env file in the root of the project folder (while testing locally), or save it as environment variables in Netlify UI.
Here’s the link to the website: https://comments-test.netlify.app/#296298668511724039
In case it’s needed, the function responsible for sending comments is here: https://github.com/Hrishikesh-K/Comments/blob/main/functions/addComment.js#L93-L105. The code above that is fetching the database entry with the required ID and getting the email address from that.
Any help will be appreciated.