Skip to content

Sends emails to the members of a group. (It needs "group-mailer-receiver" to work!)

Notifications You must be signed in to change notification settings

rabblerouser/group-mailer

Repository files navigation

group-mailer

Build Status

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:

  1. Receives a POST request pointing it at an S3 object which contains an email request.
  2. Uses the S3 data to authenticate the request and determine who should receive the final email.
  3. Puts a send-email event on the stream to send an individual email to each member of the group.

Run instructions

Pre-requisites:

  • Docker
  1. To seed:

    $ ./auto/dev-environment yarn seed

  2. To run:

    $ ./auto/dev-environment yarn start

  3. To test:

    $ ./auto/dev-environment yarn test

Send a test request

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" }] }'

Infra

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.

About

Sends emails to the members of a group. (It needs "group-mailer-receiver" to work!)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •