Deployed OpenSaaS app not sending emails
Hey there, I have deployed an OpenSaaS app via fly.io, and everything seems to be OK except for email signup.
When I try the email sign-up, I see this in the server logs, but never get an email:
2025-02-27T13:52:38Z app[1781252b571058] mia [info]POST /auth/email/signup 200 68.872 ms - 16
I am using SendGrid, and have configured a sender there and generated an API key (which was added to server env)
Would any of you know what am I missing here?
3 Replies
Hi @Gus. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the information provided in the knowledge sources, it seems that you're encountering an issue with email sending in your deployed OpenSaaS app. Let's go through some possible reasons and solutions:
1. SendGrid Configuration:
Make sure you've properly set up SendGrid in your Wasp app. According to the Wasp documentation on email sending, you need to:
- Set the provider to SendGrid in your
main.wasp
file:
- Add the SendGrid API key to your .env.server
file:
2. Environment Variables:
Ensure that the SendGrid API key is correctly set in your fly.io deployment environment. You might need to add it to your fly.io secrets or environment variables.
3. SendGrid Domain Verification:
Make sure you've verified your domain with SendGrid. This is often required to send emails from a custom domain.
4. Check SendGrid Logs:
Log into your SendGrid account and check the email activity logs. This can help you determine if SendGrid is receiving the request to send the email and if there are any issues on their end.
5. Dummy Provider for Testing:
As suggested in the Wasp documentation on email sending, you could temporarily switch to the Dummy provider for testing. This will log the emails to the console instead of actually sending them, which can help you determine if the issue is with your app or with SendGrid:
Note that the Dummy provider is only for development and won't work in production.
6. Check Server Logs:
The server log you provided shows a successful POST request to /auth/email/signup
, but it doesn't necessarily mean the email was sent successfully. Look for any error messages related to email sending in your server logs.
If none of these solutions work, you might want to double-check your SendGrid configuration, ensure all necessary environment variables are set correctly in your fly.io deployment, and possibly reach out to SendGrid support if you suspect the issue is on their end.
Remember to run wasp clean
and redeploy your app after making any changes to ensure they take effect.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Gus, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?working thank you sir robot! I guess I needed the sendgrid domain verification
Nice, I'm glad it worked out đź‘Ť đź‘Ť