April 2020
Intermediate to advanced
292 pages
6h 50m
English
With the identityEventSubscription running, we’re sending Send commands to send-email. It will send those emails and record events when it does so. We just need to observe those Sent events and make a record of it in the corresponding identity stream so that identity can know that the email was sent and that it doesn’t have to worry about it anymore.
To that end, let’s write handlers to handle those Sent events:
| 1: | function createSendEmailEventHandlers ({ messageStore }) { |
| - | return { |
| - | Sent: event => { |
| - | const originStreamName = event.metadata.originStreamName |
| 5: | const identityId = streamNameToId(originStreamName) |
| - | |
| - | const context = { |
| - | messageStore, ... |
Read now
Unlock full access