Open qd-qd opened 1 year ago
This is an automatic post that is intended to facilitate the follow-up of the project. This post is meant to be edited throughout the life of the project.
@qd-qd I will be handling this task
let's goo, let me know if you need something
Hey @qd-qd, so I have launched the npm package here, but there is one thing I want to change about the scope above...
The interface currently contains the following...
async send(to: string, message: string)
I believe we should modify this interface to look like this...
async send(to: string[], message: string)
The reason for this is that AWS and other email providers maintain an interface for emitting the emails as a string array. By changing this interface it should allow us to avoid individual calls to AWS and rather batch call where necessary.
Header
Name of the task: Plugin Email
Name of the module: Notification center
Difficulty: 3
Waiting for: #39
Body
Short description
Now that we have a server that is consumed by our "watcher module" and received notification orders, we need to do these orders. The aim of this task is to create an open-source plugin for our notification center that will be in charge to send a notification by email.
Full description
Develop a simple open-source project that can be imported into the server developed in #39 to send Email notifications. This plugin will be called by the server each time
to_type
is equal toemail
.The plugin will receive these parameters:
All the secrets that the plugin will need must be passed during the initialization of the plugin.
The plugin must have two exposed methods:
init(...)
used to init the plugin. Parameters are configuration and secrets neededasync send(to: string, message: string)
used to send a notification.The send function must return the status of the external request made.
pnpm
must be used as a dependency manager. A.nvmrc
must be set to the LTS version of node. You can decide which library you want to use to send the email, keep the code simple, and the dependencies list as small as possible. The email should be in plain text, don't create an HTML version of it. Everything must be tested, prettied, eslinted and the README of the repository should describe the plugin.Keep in mind the plugin will be an npm package.
Additionals ressources