This app listens on the HoldRequestResult streams and sends email notifications for hold success, failure, and EDD.
For more information, see this repo's wiki
It uses the NYPL PHP Microservice Starter.
This package adheres to PSR-1, PSR-2, and PSR-4 (using the Composer autoloader).
- Node 12
- PHP >=7.0
This app depends on php 7.1. Check your php version:
php --version
If you need to install php 7.1 on OSX, this may work for you:
brew tap exolnet/homebrew-deprecated
brew install php@7.1
- Clone the repo.
- Install required dependencies.
- Run
npm installto install Node.js packages. - Run
composer installto install PHP packages.
- Run
./config/var_environment configures environment variables specific to each environment.
To use node-lambda to process the sample event(s), run:
npm run test-event
HoldRequestResultConsumer handles two kinds of events:
- Hold requests from Discovery UI that have errors
- Edd requests from Discovery UI
There is a sample edd request in the events folder. This edd request has already
been processed, so it won't result in an email send. To get a successful email send,
you must send a new event through the HoldRequestService (otherwise the HoldRequestResultConsumer won't be able to find the hold). See the GitHub repo for the HoldRequestService (https://github.com/NYPL/hold-request-service) for more information on how the different components of the hold request architecture relate.
The HoldRequestResult stream can also receive events from the RecapHoldRequestConsumer. In this case HoldRequestResultConsumer will send an email as well as a PATCH request to the HoldRequestService. For more information on recap events, see:
- Diagram of NYPL Request architecture
- Detailed description of hold request scenarios with reference to above diagram
Also useful:
Travis is configured to deploy to qa and production from namesake branches.
This repo uses the Main-QA-Production Git Workflow