Skip to content

Move core email API logic into a service.

Jimmy Cuadra requested to merge jimmycuadra/email-service into dev

@DSASanFrancisco/portal-members

Similar to !283 (merged), this PR moves the logic for CRUD operations on the Email model from the controllers to a service class, so they can be called outside the context of an HTTP request. The controllers now delegate to the service.

There was no existing test for the email controllers. Tests for the new service are added here, which gives us coverage of functionality that was previously untested, but the controllers themselves remain untested. This can be added in a future patch.

Another notable addition here is a new config module, config.test_config, which introduces a TEST_MODE attribute. This is a simple boolean that can be used to bypass logic that integrates with external services like Mailgun during testing. The docker-compose configuration has been updated to enable this for commands running under the "test" docker-compose service.

Merge request reports