You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Values from this file would be automatically used by many `npm` commands.
56
58
- ⚠️ Never commit this file or its copy to the repository!
57
59
58
-
1. Set `dockerhost` to point the IP address of Docker. Docker IP address depends on your system. For example if docker is run on IP `127.0.0.1` add a the next line to your `/etc/hosts` file:
60
+
2. Set `dockerhost` to point the IP address of Docker. Docker IP address depends on your system. For example if docker is run on IP `127.0.0.1` add a the next line to your `/etc/hosts` file:
59
61
60
62
```
61
63
127.0.0.1 dockerhost
@@ -170,6 +172,8 @@
170
172
Runs the Topcoder TaaS API using nodemon, so it would be restarted after any of the files is updated.
171
173
The Topcoder TaaS API will be served on `http://localhost:3000`.
172
174
175
+
- 💡 If you would like to test Interview Workflow locally, then follow the guide [How to Setup Interview Workflow Locally](./docs/guides/Setup-Interview-Workflow-Locally.md).
176
+
173
177
### Working on `taas-es-processor` locally
174
178
175
179
When you run `taas-apis` locally as per "[Steps to run locally](#steps-to-run-locally)" the [taas-es-processor](https://github.com/topcoder-platform/taas-es-processor) would be run for you automatically together with other services inside the docker container via `npm run services:up`.
@@ -224,7 +228,7 @@ To be able to change and test `taas-es-processor` locally you can follow the nex
224
228
|`npm run cov`| Code Coverage Report. |
225
229
|`npm run migrate`| Run any migration files which haven't run yet. |
226
230
| `npm run migrate:undo` | Revert most recent migration. |
227
-
| `npm run demo-payment-scheduler` | Create 1000 Work Periods Payment records in with status "scheduled" and various "amount" |
231
+
| `npm run demo-email-notifications` | Listen to the Kafka events of email notification and render all the emails into `./out` folder. See [its readme](scripts/demo-email-notifications/README.md) for details. |
228
232
| `npm run emsi-mapping` | mapping EMSI tags to topcoder skills |
- Enter or copy/paste the message into the console after starting this command.
296
300
301
+
## Email Notifications
302
+
303
+
We have various email notifications. For example many emails are sent to support Interview Scheduling Workflow. All email templates are placed inside the [.data/notification-email-templates](./data/notification-email-templates/) folder.
304
+
305
+
### Add a new Email Notification
306
+
307
+
To add a new email notification:
308
+
309
+
0. Each email notification need to have a unique topic identifier of the shape `taas.notification.{notification-type}`. Where `{notification-type}` is unique for each email notification type.
310
+
1. Create a new HTML template inside folder [.data/notification-email-templates](./data/notification-email-templates/). (You may duplicate any existent template to reuse existent styles.). Name it the same as topic: `taas.notification.{notification-type}.html`.
311
+
2. Create a corresponding config in file [./config/email_template.config.js](./config/email_template.config.js), section `notificationEmailTemplates`.
312
+
3. Name environment variable the same as topic, but **uppercase** and replace all special symbols to `_` and add suffix `_SENDGRID_TEMPLATE_ID`:
313
+
- For example topic `taas.notification.job-candidate-resume-viewed` would have corresponding environment variable
4. When deploying to DEV/PROD someone would have to create a new Sendgird template and fill inside Sendgrid UI subject and email HTML template by copy/pasting HTML file from the repo. And thenset environment variable with the value of template if provided by Sendgrid.
316
+
317
+
### Test/Render Email Notifications Locally
318
+
319
+
To test and render email notification locally run a special script `npm run demo-email-notifications`. Before running it, follow it's [README](./scripts/demo-email-notifications/README.md) as you would have to set some additional environment variables first (add them into `.env` file).
320
+
321
+
- This script first would update demo data to create some situations to trigger notifications.
322
+
- And it would listen to Kafka events and render email notification into `./out` folder.
323
+
297
324
## DB Migration
298
325
299
326
- `npm run migrate`: run any migration files which haven't run yet.
@@ -303,10 +330,7 @@ Configuration for migration is at `./config/config.json`.
303
330
304
331
The following parameters can be setin the config file or via env variables:
305
332
306
-
- `username`: set via env `DB_USERNAME`; datebase username
307
-
- `password`: set via env `DB_PASSWORD`; datebase password
308
-
- `database`: set via env `DB_NAME`; datebase name
309
-
- `host`: set via env `DB_HOST`; datebase host name
333
+
- `url`: set via env `DATABASE_URL`; datebase url
310
334
311
335
## Testing
312
336
@@ -341,6 +365,7 @@ When we add, update or delete models and/or endpoints we have to make sure that
341
365
- Test, that when we migrate DB from the previous state using `npm run migrate`, we get exactly the same DB schema as if we create DB from scratch using command`npm run init-db force`.
342
366
343
367
## EMSI mapping
368
+
344
369
mapping EMSI tags to topcoder skills
345
370
Run `npm run emsi-mapping` to create the mapping file
346
371
It will take about 15 minutes to create the mapping file `script/emsi-mapping/emsi-skils-mapping.js`
0 commit comments