fix(mailhog): use docker network address in containers (#54877)

This commit is contained in:
Oliver Eyton-Williams
2024-05-23 11:21:32 +02:00
committed by GitHub
parent 5ae52fdef9
commit 6fe2b0811f
2 changed files with 3 additions and 1 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
import nodemailer, { Transporter } from 'nodemailer';
import { MailProvider, SendEmailArgs } from '../mailer';
import { MAILHOG_HOST } from '../../utils/env';
/**
* NodemailerProvider is a wrapper around nodemailer that provides a clean
@@ -15,7 +16,7 @@ export class NodemailerProvider implements MailProvider {
*/
constructor() {
this.transporter = nodemailer.createTransport({
host: 'localhost',
host: MAILHOG_HOST,
secure: false,
port: 1025,
auth: {
+1
View File
@@ -104,6 +104,7 @@ if (process.env.FREECODECAMP_NODE_ENV !== 'development') {
}
export const HOME_LOCATION = process.env.HOME_LOCATION;
export const MAILHOG_HOST = process.env.MAILHOG_HOST ?? 'localhost';
export const MONGOHQ_URL =
process.env.NODE_ENV === 'test'
? createTestConnectionURL(