Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/lblod/complaint-form-email-converter-service
- Owner: lblod
- License: mit
- Created: 2019-01-14T14:59:21.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-01-11T17:00:58.000Z (12 months ago)
- Last Synced: 2024-04-16T06:36:59.901Z (8 months ago)
- Topics: mu-service
- Language: JavaScript
- Size: 94.7 KB
- Stars: 0
- Watchers: 17
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Support: support.js
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.