Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lblod/complaint-form-email-converter-service

Service converting forms from the complaint from app to emails
https://github.com/lblod/complaint-form-email-converter-service

mu-service

Last synced: 21 days ago
JSON representation

Service converting forms from the complaint from app to emails

Awesome Lists containing this project

README

        

# `complaint-form-email-converter-service`

Microservice that converts Complaint Forms to emails and places those emails
into an outbox. They will then be picked up by an email sending service.

This service listens to `delta-notifier` messages about new Complaint Form
entries. In addition, it runs a (rather infrequent) cron job to query the
database for forms that have not been converted as a failover mechanism.

## Installation

### Docker-compose snippet

To add the service to your stack, add the following snippet to
`docker-compose.yml`:

```yaml
services:
complaint-form-email-converter-service:
image: lblod/complain-form-email-converter-service
environment:
COMPLAINT_FORM_GRAPH: "http://graph.uri"
[...]
volumes:
- ./app/templates/:/app/templates/
```

Optionally, you can put the following snippet in the `delta-notifier` config:

```javascript
{
match: {
predicate: {
type: 'uri',
value: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type',
},
object: {
type: 'uri',
value: 'http://mu.semte.ch/vocabularies/ext/ComplaintForm',
},
},
callback: {
url: 'http://complaint-form-email-converter/delta',
method: 'POST',
},
options: {
resourceFormat: 'v0.0.1',
gracePeriod: 250,
ignoreFromSelf: true,
},
},

```

### Environment variables

* `COMPLAINT_FORM_CRON_PATTERN`: (optional, default: '0 * * * *' (= every
hour))
Frequency of the cron job for scanning unconverted forms.
* `COMPLAINT_FORM_GRAPH`: (optional, default:
'http://mu.semte.ch/graphs/public')
The graph to query the Complaint
Form data from.
* `FILE_GRAPH`: (optional, default:
'http://mu.semte.ch/graphs/public')

* `EMAIL_GRAPH`: (optional, default:
'http://mu.semte.ch/graphs/system/email')
The graph to store the
converted emails to.
* `EMAIL_FROM_ADDRESS_TO_COMPLAINER`: (optional, default:
'[email protected]')

* `EMAIL_FROM_ADDRESS_TO_ABB`: (optional, default:
'[email protected]')

* `EMAIL_TO_ADDRESS`: (optional, default: '[email protected]')
* `CREATOR`: (optional, default:
'http://lblod.data.gift/services/complaint-form-email-converter-service')

The URI for this service that will be linked to in error messages.
* `ERROR_GRAPH`: (optional, default:
'http://mu.semte.ch/graphs/error')
The graph in which to store errors.
* `ERROR_BASE`: (optional, default: 'http://data.lblod.info/errors/')
The base for URIs of errors.