rabblerouser / core

Pluggable, extensible membership database for community organising
GNU Affero General Public License v3.0
17 stars 10 forks source link

Email everyone in an organisation #160

Closed phazel closed 6 years ago

phazel commented 7 years ago

As a super admin, I want to email everyone in my organisation, so I can mobilise them.

WHEN I send an email to everyone@my-org.click, THEN it gets sent to all members.

Out of scope:

We're doing a simpler version which is just about sending to everyone in an organisation, and then extending it to groups later. For now we're ignoring groups.

Glorious architecture diagram of great justice:

img_20170614_180357

Clockwise from top-left:

  1. Someone sends an email to the special email address, which is received by SES.
  2. 161 SES uploads the email content into an S3 bucket

  3. 140 SES invokes a lambda (the group-mail-receiver) with the email metadata

  4. 140 The group-mail-receiver sends an HTTP POST to the group-mailer.

  5. 141 The group-mailer resolves the 'everyone' request into a concrete list of members, which it is able to do because it listens for events such as member-registered, etc.

  6. 141 The group-mailer puts a send-email event onto the stream, which includes a reference to the S3 object, but not the full email body

  7. 163 The mailer receives the event via the its event-forwarder lambda.

  8. 163 The mailer retrieves the full email data from S3, and sends the email to everyone listed in the event, via SES.

  9. 163 (not shown) The mailer puts success/failure events back on the stream.

camjackson commented 7 years ago

Treating this as the meta-issue to track progress on this feature. I wanted to use a milestone, but milestone descriptions don't seem to support proper markdown so the formatting was all whacked.

camjackson commented 7 years ago

Slightly updated diagram (main difference is that the group-mail-receiver is triggered by S3, not SES: img_0145

camjackson commented 6 years ago

It works!