Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

[Write | EmailSender] Create slice SendEmailMessage -> EmailMessageWasSent #261

@MateuszNaKodach

Description

@MateuszNaKodach

Dependencies (blockers)

  • No blockers. Ready to go!

Subtasks
Command definition:

  • 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

Screenshot from MIRO (Event Modeling):

CodersCamp App _ Event Storming - Frame 3 (3)

Metadata

Metadata

Labels

scope: 🛰 apiRequires changes in the api workspacetype: ✨ featAnother new, shiny thing we can have in our app

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions