Skip to content

netlify email integration with mailgun (email trunk)#91

Open
interim17 wants to merge 8 commits intofeature/contact-queryfrom
mailgun
Open

netlify email integration with mailgun (email trunk)#91
interim17 wants to merge 8 commits intofeature/contact-queryfrom
mailgun

Conversation

@interim17
Copy link
Copy Markdown
Contributor

@interim17 interim17 commented Mar 26, 2026

Problem

Closes #44, #61, #62, and #63

Reviewers: only Megan and I have access to the netlify back end right now, please feel free to just read and review without confirming the function is performing as advertised.

Solution

Signed us up for a mailgun account and configured the necessary environment variables to use netlify email integration:
https://docs.netlify.com/extend/install-and-use/setup-guides/email-integration/#required-environment-variables

Added an email template in /emails per above docs.

Added a /docs directory to start storing more case-specific advice for devs and LLMs that might previously have gone in README or CONTRIBUTING. We're using this pattern in aics-lims and I like it.

When testing this locally I was able to successfully send an email to my personal gmail through the contact form. CONTACT_IDEA_BOARD is still the only contactId -> email mapping that is provisioned on the backend.

If testing this be aware that our domain for mailgun is a sandbox that gets flagged as spam. We will need to work with infra and/or central IT to provision a domain or subdomain for this project.

Screenshot 2026-03-26 at 11 30 09 AM

@interim17 interim17 changed the title Mailgun netlify email integration with mailgun (email trunk) Mar 26, 2026
@interim17 interim17 requested a review from Copilot March 26, 2026 20:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Netlify Email Integration (Mailgun) support so the site’s contact form can send templated emails via Netlify’s built-in emails function, and documents local/prod setup for developers.

Changes:

  • Added @netlify/plugin-emails and configured Netlify to include the emails build plugin.
  • Updated the contact Netlify Function to render/send an email via /.netlify/functions/emails/contact.
  • Added an email template (emails/contact/index.html) plus developer docs and a sample .env for local setup.

Reviewed changes

Copilot reviewed 8 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
yarn.lock Locks new dependencies introduced by the Netlify emails plugin.
src/components/ContactModal.tsx Includes ideaTitle in the contact request payload for better email context.
package.json Adds @netlify/plugin-emails to support Netlify’s email integration.
netlify/functions/contact.mts Implements email sending by calling the internal Netlify emails endpoint.
netlify.toml Registers the Netlify emails build plugin.
gatsby/utils/gatsby-resolver-utils.js Minor export formatting tweak.
emails/contact/index.html Adds the Handlebars email template used by the emails integration.
docs/NETLIFY.md Documents Netlify CLI/linking and required env vars for email integration.
docs/.env.example Provides local env var template for Mailgun/Netlify emails integration.
.gitignore Ignores local .env file.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@interim17 interim17 marked this pull request as ready for review March 26, 2026 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants