Setting Up Email Notifications

To enable email notifications with Mailgun in your Startup Template project, follow these steps to obtain the necessary environment variables.

Create a Mailgun Account

  1. Sign Up for Mailgun:

    • Go to Mailgun and sign up for an account.

  2. Set Up Your Domain:

    • After signing up, set up your domain within the Mailgun dashboard.

    Mailgun domains

Obtain Mailgun API Keys

  1. Retrieve Your Domain Information:

    • Once your domain is set up, navigate to your domain settings in the Mailgun dashboard.

  2. Get Your Domain Details:

    • Note down your Mailgun domain, sender email address.

    • Generate Mailgun API key from api_security page.

    Mailgun api keys

Add to .env File

  1. Open Your .env File:

    • Open your project's .env file.

  2. Add Mailgun Environment Variables:

    • Add the following variables to your .env file:

Example .env File

Here is an example of what your .env file should look like after adding Mailgun environment variables:

Final Steps

  1. Save Your Changes:

    • Save the changes to your .env file.

  2. Restart Your Server:

    • If your server is already running, restart it to apply the changes.

  3. Test Email Notifications:

    • Verify that email notifications are working as expected in your project.

Additional Resources


Need Help?

If you have any feedback or run into any issues, don't hesitate to reach out at [email protected].

Happy coding!

Last updated

Was this helpful?