You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 20, 2023. It is now read-only.
Create command type SendEmailMessage in modules/shared/commands
Create SendEmailMessageApplicationCommand class in modules/shared/commands
Domain logic:
Create function sendEmailMessage in modules/write/email-sender/domain.
Take SendEmailMessage and appEmailAddress as parameters. appEmailAddress will be from of EmailMessageWasSent
Return EmailMessageWasSent on every SendEmailMessage.
Application logic:
Create env variable like APP_EMAIL_ADDRESS and use it as argument of sendEmailMessage.
Create CommandHandler for SendEmailMessageApplicationCommand
Send email using Nodemailer before saving EmailMessageWasSent event (executing domain logic).
Execute domain logic for sendEmailMessage task. Event stream name should be in format EmailMessage_${emailMessageId}
Infrastructure
Configure node-mailer library. Try to use port & adapters architecture. Prepare in application layer port (interface) for sender and implement adapter which will invoke node-mailer.
Testing strategy
Write tests for your module by invoking command and checking published event.