You just got a new job at a magazine. The CEO tells you that they're losing a lot of business, and they're pretty sure it's because people aren't checking their mailboxes for renewal forms anymore. His solution? Use email instead! He asks you to write a program that will email subscribers that are within three months of their subscription expiring with the message "Please renew your subscription to Ferret Fancy!"
Design a solution that leverages the concept of Logical Core, Collaborative Shell to successfully notify these customers that they need to renew their subscriptions. The two APIs that you will interact with are provided below. Maintain a proper separation in your design so that the logic can be tested with unit tests, and API collaboration can be tested with integration tests. Use the WireMock library to stand-in for the APIs during your integration tests.
URL: http://example.domain/subscribers
Method: GET
Example Results
[
{ "name": "", "email": "", "expirationDate": "2050-01-15" },
{ "name": "", "email": "", "expirationDate": "2050-03-27" }
]
URL: http://example.domain/mail
Method: POST
Example Results
{
"subject": "An Important Message from Ferret Fancy",
"body": "Please renew your subscription to Ferret Fancy!",
"to": ["[email protected]", "[email protected]"],
"from": "[email protected]"
}