Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup MailHog in Docker to send test notifications #146

Merged
merged 1 commit into from
Feb 7, 2023
Merged

Setup MailHog in Docker to send test notifications #146

merged 1 commit into from
Feb 7, 2023

Conversation

SerpentBytes
Copy link
Contributor

@SerpentBytes SerpentBytes commented Feb 7, 2023

Description

This PR resolves #126 by setting up MailHog in Docker to test sending notification emails in the development environment.

Steps to Test

  1. cp .env.example .env
  2. npm run docker
  3. npm run setup
  4. npm run build
  5. npm run dev
  6. Navigate to MailHog UI at localhost:8025:

Screenshot 2023-02-07 at 9 43 20 PM

Additional Information

There are currently no tests implemented to check whether we are able to send notifications successfully. I intend on implementing tests for notifications in a follow-up PR.

@SerpentBytes SerpentBytes added category: back end Back end part of our web service category: notifications A service to notify users about their certificates/domains labels Feb 7, 2023
@SerpentBytes SerpentBytes added this to the Milestone 0.2 milestone Feb 7, 2023
@SerpentBytes SerpentBytes self-assigned this Feb 7, 2023
humphd
humphd previously approved these changes Feb 7, 2023
Copy link
Contributor

@humphd humphd left a comment

Choose a reason for hiding this comment

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

One suggestion, looks great otherwise.

cc @sirinoks, we should add some docs about how to use this new test email server in development. It's really cool, you can go to http://localhost:8025 and you have a GMail like UI that shows you the emails you've sent. There is also an API you can use in testing, which @td will probably document when he writes tests.

.env.example Outdated
@@ -11,3 +11,7 @@ PORT=8080

# One of: trace, debug, info, warn, error, fatal, silent
LOG_LEVEL=debug

# Nodemailer config
NODEMAILER_USER="[email protected]"
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's rename this to NOTIFICATIONS_EMAIL_USER. The nodemailer bit is an internal detail that admins of the system won't care about. Add a comment above it that indicates what it's for.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@humphd resolved in latest commit.

Genne23v
Genne23v previously approved these changes Feb 7, 2023
Copy link
Contributor

@Genne23v Genne23v left a comment

Choose a reason for hiding this comment

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

It looks good to me!

 * Add nodemailer env var
 * Add mailhog smtf port
 * setup malhog
 * Add alternative dev transport to use for testing
 * update typo in mailhog env var
 * remove quotes from mailhog setup in docker-compose
 * improve nodemailer module
 * Update nodemail user variable name
 * replace NODEMAILER_USER with NOTIFICATIONS_EMAIL_USER
@SerpentBytes SerpentBytes dismissed stale reviews from Genne23v and humphd via 958cce6 February 7, 2023 17:52
@SerpentBytes SerpentBytes requested review from humphd and a user February 7, 2023 17:56
@SerpentBytes SerpentBytes merged commit 10707b5 into DevelopingSpace:main Feb 7, 2023
@SerpentBytes SerpentBytes deleted the issue-126 branch February 7, 2023 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: back end Back end part of our web service category: notifications A service to notify users about their certificates/domains
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use MailHog in Docker for testing notification emails
3 participants