@@ -163,8 +163,8 @@ The project is composed of 4 resources:
163
163
164
164
### Transactors
165
165
166
- At the moment the application uses two transactors/vendors for delivering emails
167
- (in this order):
166
+ An implementation of ` MailerTransactor ` . At the moment the application uses two
167
+ transactors/vendors for delivering emails (in this order):
168
168
169
169
- ** Mailjet**
170
170
- ** Sendgrid**
@@ -183,9 +183,10 @@ on it (which are used by the tests).
183
183
184
184
### Worker
185
185
186
- The email worker implements the Chain of Responsibility pattern
187
- when attempting to deliver emails. It tries to send an email through a given vendor,
188
- if it doesn't work then it tries with the next one and so on.
186
+ The email worker has an array of ` MailerTransactors ` and it tries to send an email
187
+ through each one, in case of one failing then it goes to the next,
188
+ in case of success it finishes the worker with a boolean ` true ` , making it clear
189
+ the email was sent. If none vendor worked, then the worker finishes with a ` false ` .
189
190
190
191
In case of being needed to add a new vendor then these are the steps required:
191
192
@@ -194,12 +195,9 @@ In case of being needed to add a new vendor then these are the steps required:
194
195
- Create a connector class for the new vendor service
195
196
- Example: the ` Mailjet ` connector creates an instance of a ` Mailjet Client ` (third-party vendor).
196
197
- Create a ** singleton** instance for the new connector created (in ` EmailServiceProvider ` ).
197
- - Create a transactor class for the new vendor service. This transactor will be responsible
198
- for preparing the payload, sending the email and calling the trigger
199
- (to call the next transactor in case of failure).
200
- - Update the last transactor already created by injecting the new transactor as a dependency.
201
- - Update the last transactor ` sendTrigger ` method to call the new transactor
202
- (just like it's done in ` MailjetTransactor ` class, in ` sendTrigger ` method).
198
+ - Create a transactor class for the new vendor service. This transactor will be responsible for
199
+ sending the email only. This transactor must implements ` MailerTransactor ` interface.
200
+ - Add the new transactor to the ` AppServiceProvider ` , as a dependency in the ` EmailWorker ` bind.
203
201
204
202
### Queue
205
203
@@ -294,6 +292,8 @@ $ docker-compose -f infrastructure/docker-compose.yml up --scale email=2 --scale
294
292
- Create a frontend application to list the messages based on endpoint created above
295
293
- Create a form in the frontend in order to also create new emails
296
294
- Add Swagger for API documentation
295
+ - Add a repository for the ` Queue ` entity
296
+ - Add Kubernetes to the stateful and stateless resources
297
297
298
298
## API - Resources
299
299
0 commit comments