Skip to content

feat(email): redirect emails in development to avoid spamming customers

Ben Whitmore requested to merge redirect-emails-in-development-20230825 into main

To prevent inadvertently sending emails to customers, especially when testing on data retrieved from a customer's DB. Previously, if you restored from a customer's DB dump you would risk automated emails being sent to customers as soon as the server starts, before you even have a chance to change configuration.

If Kotahi is running in 'development' mode, or running on localhost (or 0.0.0.0 or 127.0.0.1), this will prevent emails being sent to their declared recipients, and instead direct them to the email address specified in TEST_EMAIL_RECIPIENT env variable. If that variable is unset, emails will not be sent at all.

If Kotahi is running in production mode and not on localhost, emails will be sent as normal.

Merge request reports