Skip to content

A PHP Lambda for sending e-mail notifications on hold request results.

Notifications You must be signed in to change notification settings

NYPL/hold-request-result-consumer

Repository files navigation

Build Status Coverage Status

NYPL Hold Request Result Consumer

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).

Requirements

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

Installation

  1. Clone the repo.
  2. Install required dependencies.
    • Run npm install to install Node.js packages.
    • Run composer install to install PHP packages.

Configuration

./config/var_environment configures environment variables specific to each environment.

Usage

Process a Lambda Event

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:

Also useful:

Deployment

Travis is configured to deploy to qa and production from namesake branches.

Contributing

This repo uses the Main-QA-Production Git Workflow

About

A PHP Lambda for sending e-mail notifications on hold request results.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •