W
Wasp•3mo ago
johnsharp.

Using dummy email locally and Mailgun on environment

How can use Dummy email sender locally and then Mailgun when deployed to an environment is there some config to setup in main.wasp
3 Replies
kapa.ai
kapa.ai•3mo ago
Hi @johnsharp.. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Currently, Wasp does not support dynamic configuration in the main.wasp file. This means you cannot directly set the email provider to Dummy for development and Mailgun for production within the main.wasp file. However, you can manually change the email provider in the main.wasp file based on the environment. For local development, you can set the email provider to Dummy:
app Example {
...
emailSender: {
provider: Dummy,
}
}
app Example {
...
emailSender: {
provider: Dummy,
}
}
Source: Using the Dummy Provider (https://wasp-lang.dev/docs/advanced/email#using-the-dummy-provider) And when you're ready to deploy your application, you can change the email provider to Mailgun:
app Example {
...
emailSender: {
provider: Mailgun,
}
}
app Example {
...
emailSender: {
provider: Mailgun,
}
}
Source: Using the Mailgun Provider (https://wasp-lang.dev/docs/advanced/email#using-the-mailgun-provider) Remember to also set the Mailgun API key and domain in your .env.server file when deploying:
MAILGUN_API_KEY=
MAILGUN_DOMAIN=
MAILGUN_API_KEY=
MAILGUN_DOMAIN=
Source: Using the Mailgun Provider (https://wasp-lang.dev/docs/advanced/email#using-the-mailgun-provider) Please note that the Dummy provider is not for production use. It is only meant to be used during development. If you try building your app with the Dummy provider, the build will fail. Source: emailSender dict (https://wasp-lang.dev/docs/advanced/email#emailsender-dict) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @johnsharp., 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?
miho
miho•3mo ago
It's not currently possible to have two different values in your Wasp file for dev and production. Wasp would need to support using env vars in the config to make this happen. For now, you'll have to manually edit the file each time 😄
johnsharp.
johnsharp.OP•3mo ago
No problem, thanks
Want results from more Discord servers?
Add your server