-
Notifications
You must be signed in to change notification settings - Fork 19
Testing Action Mailer Messages Locally
This guide will walk you through how to set up a MailDev server locally for use in ensuring email events are processed in Caseflow correctly.
In order to have emails from your development instance of Caseflow be sent to a Maildev inbox you only need to follow these two steps:
- In a terminal, run a
maildev
container:
docker run -p 1080:1080 -p 1025:1025 maildev/maildev
- Keep this terminal open, or run the container with
docker run -d
to have it run detached in the background.
- Run the Caseflow backend with the
WITH_TEST_EMAIL_SERVER
environmental variable assignment prepending the typicalmake run-backend
command:
WITH_TEST_EMAIL_SERVER=true make run-backend
That's it! You should now be able to observe email events that have occurred in Caseflow by navigating to http://localhost:1080/ in your web browser.
For convenience, feel free to add the following line to your runtime config file (~/.bashrc or ~/.zshrc, most likely):
alias start-mail-server="docker run -p 1080:1080 -p 1025:1025 maildev/maildev"
Once you open a new terminal/run source ~/.<rc-file-name>
you will be able to start Maildev with the start-mail-server
command.
Just like with the Caseflow backend, if you'd like to have the Rails Console send email messages to your local email server you will need to set the WITH_TEST_EMAIL_SERVER
environmental variable prior to opening the console:
WITH_TEST_EMAIL_SERVER=true make c
If you need to test email notifications that are being sent out via a job, you can spin up the respective Shoryuken queue with the appropriate make command:
WITH_TEST_EMAIL_SERVER=true make run-low-priority
If for whatever reason you require Maildev to listen on a different port than 1025, you can run the container with:
docker run -p 1080:1080 -p XXXX:1025 maildev/maildev
Where XXXX
is your custom port.
To have the Caseflow backend utilize this port, you can set the TEST_MAIL_SERVER_PORT
environmental variable:
WITH_TEST_EMAIL_SERVER=true TEST_MAIL_SERVER_PORT=XXXX make run-backend
- Home
- Acronyms and Glossary
- Caseflow products
- Caseflow Intake
- Caseflow Queue
- Appeals Consumer
- Caseflow Reader
- Caseflow eFolder
- Caseflow Hearings
- Caseflow Certification
- Caseflow APIs
- Appeal Status API
- Caseflow Dispatch
-
CSUM Roles
- System Admin
- VHA Team Management
- Active Record Queries Resource
- External Integrations
- Caseflow Demo
- Caseflow ProdTest
- Background
- Stuck Jobs
- VA Notify
- Caseflow-Team
- Frontend Best Practices
- Accessibility
- How-To
- Debugging Tips
- Adding a Feature Flag with FeatureToggle
- Editing AMA issues
- Editing a decision review
- Fixing task trees
- Investigating and diagnosing issues
- Data and Metric Request Workflow
- Exporting and Importing Appeals
- Explain page for Appeals
- Record associations and Foreign Keys
- Upgrading Ruby
- Stuck Appeals
- Testing Action Mailer Messages Locally
- Re-running Seed Files
- Rake Generator for Legacy Appeals
- Manually running Scheduled Jobs
- System Admin UI
- Caseflow Makefile
- Upgrading Postgresql from v11.7 to v14.8 Locally
- VACOLS VM Trigger Fix M1
- Using SlackService to Send a Job Alert
- Technical Talks