Adding a new Email provider
"Wasp's email providers are built into the framework itself, so we can't add new providers directly"
I want to create a new email provider that's not part of the wasp framework (SendGrid, Mailgun). How can I go about doing that?
2 Replies
Hi @Juan. 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 knowledge sources, Wasp currently supports a limited set of built-in email providers: Dummy (development only), SMTP, Mailgun, and SendGrid. The framework doesn't currently provide a direct way to add custom email providers beyond these options.
However, here are your alternatives:
1. Use the SMTP Provider
The most flexible built-in option is to use the SMTP provider, which works with many transactional email services. According to the documentation, "Many transactional email providers (e.g. Mailgun, SendGrid but also others) can also use SMTP, so you can use them as well."
To set it up:
Then add your SMTP credentials to
.env.server:
2. Use the Provider's Node.js SDK Directly
If you need provider-specific features that aren't supported by Wasp's emailSender API (like SendGrid's send_at for scheduling emails or template IDs), you can bypass Wasp's email system and use the provider's Node.js package directly in your actions or jobs. As suggested in a Discord discussion, you can "replace that function with the twilio node package" (SendGrid's SDK).
This approach gives you full access to all provider-specific features, though you'll need to handle the integration yourself.
Note: There's an open GitHub issue requesting support for provider-specific options in Wasp's email API, which may be addressed in future versions.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Juan, 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?Updated to use an Email API via https instead