I\'m struggling to get my head around what should happen when rebuilding the model by replaying events from the EventStore, in particular when events may trigger other events t
You should not raise event from event handler - just don't do it! You should use sagas instead.
In your case, saga subscribes for PurchaseMadeEvent
and issues PromoteCustomer
COMMAND, which causes to happen CustomerPromoted
event. Again, there is another saga that subscribes for CustomerPromoted
event and sends SendEmailToPromotedCustomer
command. When you are replaying events - just don't subscribe saga for CustomerPromoted
event.
This is all about the difference between command and event. It is important to understand it. Events tell what already has happened, commands tell what will happen.