CQRS and email notification
Posted
by t0PPy
on Stack Overflow
See other posts from Stack Overflow
or by t0PPy
Published on 2010-05-26T13:43:17Z
Indexed on
2010/05/26
21:11 UTC
Read the original article
Hit count: 307
Reading up on CQRS there is a lot of talk of email notification - i'm wondering where to get the data from. Imagine a senario where one user invites other users to an event. To inform a user that he has been invitet to an event, he is send an email.
The concrete mecanics might go like this:
- A "CreateEvent" command with an associated collection of user to invite, is received by the server.
- A new meeting aggregate is created and a method "InviteUser" is called for each user that is to be invited.
- Each time a user is invited to an event, a domain event "UserWasInvitedToEvent" is raised.
- An email notification sender picks up the domain event and sends out the notification email.
Now my question is this: Where do i go for information to include in the email?
Say i want to include a description of the event as well as the users name. Since this is CQRS i can't get it thru my domain model; All the properties of the domain objects are private! Should i then query the write side? Or maybe move email notification to a different service entirely?
Any thoughts will be much appriciated!
© Stack Overflow or respective owner