Skip to content

Commit

Permalink
pr-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SirDomin committed Nov 19, 2020
1 parent 02ca9e6 commit e537bd4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions adr/2020_11_18_sending_emails_via_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

## Context and Problem Statement

To achieve 100% api coverage, we need to handle emails by api.
To achieve 100% API coverage, we need to handle emails by api.

## Considered Options

Expand Down Expand Up @@ -33,7 +33,10 @@ $this->emailSender->send(
);
```

* Good, because its sending email based on triggered event, once understood it's simple to add new handlers.
* Good, because it's easy to integrate other logic after the initial command will succeed.
* Good, because it's easy to trigger the same operation several times.
* Good, because it's easier to handle mailing server downs gracefully.

* Bad, because adds a lot of abstraction, can be hard to understand.

### Direct email call
Expand All @@ -46,6 +49,7 @@ $this->emailManager->sendConfirmationEmail($cart);
```

* Good, because its easy to understand.

* Bad, because it can generate a lot of problems in future as it should be sent asynchronously, email manager class should be changed to handle it somehow, hard to implement.

## Decision Outcome
Expand Down

0 comments on commit e537bd4

Please sign in to comment.