Rabble Rouser service use to send emails to the member of a group.
** It needs a group-mail-receiver to notify it when new email request objects are uploaded to S3.**
The service:
- Receives a POST request pointing it at an S3 object which contains an email request.
- Uses the S3 data to authenticate the request and determine who should receive the final email.
- Puts a
send-email
event on the stream to send an individual email to each member of the group.
Pre-requisites:
- Docker
-
To seed:
$ ./auto/dev-environment yarn seed
-
To run:
$ ./auto/dev-environment yarn start
-
To test:
$ ./auto/dev-environment yarn test
To test the application manually, you can simulate the uploading of an email to S3, and then trigger the application via POST request. With the services all started (see above), run these commands:
aws --endpoint-url='http://localhost:4569' s3api put-object --bucket email-bucket --key some-email-object --body src/fixtures/mimeFile.txt
curl localhost:3000/mail -H 'Content-Type: application/json' -d '{ "emailRecords": [{ "key": "some-email-object" }] }'
The terraform code to create the group-mailer instance is currently living in the group-mail-receiver
repo, because all of the other group mail related things are created there already (eg. the S3 bucket for emails). We're still making decisions about how we want to structure our terraform code, and so for now this is where it makes sense. We know it's counter-intuitive, and it's not going to stay there.