A simple tool to periodically check the bloxberg validators and send them emails to addresses which are retrieved from Cobra contacts. Current setting checks if validators have been online since 3 days and runs every Monday at 13:00.
- nodejs
- npm
or
- Docker
npm install
or run in Docker. See below.
Export the techie and consoritum contacts in the .csv format. The file from Cobra should have the following fields:
Haupt,Institution,Institut,Anrede,Titel,Vorname1,Nachname1,E-Mail1,Bemerkung
Important if you'll do a custom search in Cobra don't forget to exclude inactive users. Always use the saved search.
There are existing settings in Cobra CRM for exporting. To do that go to the tab Recherche. There select Gespeicherte Recherchen. In Bereich System, choose Bloxberg Techies Monitoring. Click Ausführen. Then in Daten tab click Exportieren. In the settings there is an ready made formatting called 'Validator Monitoring - Techies'. Choose the setting and export the file. The file name must be bloxberg_techies.csv
.
Do the similar steps for all consortium contacts. Go to the tab Receherche. Click Gespeicherte Recherchen. In Bereich System, choose Bloxberg Consortium Monitoring. In Data tab click Exportieren. The formatting is call 'Validator Monitoring - Consortium'. Choose the setting and export the file. The file name must be bloxberg_consortium.csv
.
Finally copy the files bloxberg_techies.csv
and bloxberg_consortium.csv
in the project root.
Copy the file .env-template
to a new file called .env
. Add the SMTP credentials for each variable. You can use a service like Sendgrid to test emails.
Set the cron schedule at index.js
.
Run the script with
node index.js
You can run the script in a lightweight container with:
docker-compose up
Run in background
docker-compose up -d
If you made a change, don't forget to rebuild the container with
docker-compose up -d --build
Logs will be written to logs/
in winston format. Example:
logger.log("Something happens", obj);
Gets saved as
{
timestamp: Date,
level: 'info',
message: 'Something happens',
metadata: obj
}