Skip to content

Commit ddd7e64

Browse files
authored
Merge branch 'feature/notifications-api' into issue-475
2 parents ad4c66a + b98a7ca commit ddd7e64

19 files changed

+11690
-68
lines changed

config/default.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ module.exports = {
142142
TAAS_ROLE_UPDATE_TOPIC: process.env.TAAS_ROLE_UPDATE_TOPIC || 'taas.role.update',
143143
// the delete role entity Kafka message topic
144144
TAAS_ROLE_DELETE_TOPIC: process.env.TAAS_ROLE_DELETE_TOPIC || 'taas.role.delete',
145+
// the create team entity message topic, only used for eventHandler
146+
TAAS_TEAM_CREATE_TOPIC: process.env.TAAS_TEAM_CREATE_TOPIC || 'taas.team.create',
145147
// special kafka topics
146148
TAAS_ACTION_RETRY_TOPIC: process.env.TAAS_ACTION_RETRY_TOPIC || 'taas.action.retry',
147149

@@ -161,6 +163,10 @@ module.exports = {
161163
// INTERVIEW_INVITATION_RECIPIENTS_LIST may contain comma-separated list of email which is converted to array
162164
// scheduler@x.ai should be in the RECIPIENTS list
163165
INTERVIEW_INVITATION_RECIPIENTS_LIST: (process.env.INTERVIEW_INVITATION_RECIPIENTS_LIST || 'scheduler@topcoder.com').split(','),
166+
// the emails address for overlapping interview
167+
NOTIFICATION_OPS_EMAILS: (process.env.NOTIFICATION_OPS_EMAILS || 'overlapping@topcoder.com').split(','),
168+
// the slack channel for sending notifications
169+
NOTIFICATION_SLACK_CHANNEL: process.env.NOTIFICATION_SLACK_CHANNEL || '#dev-general',
164170
// SendGrid email template ID for reporting issue
165171
REPORT_ISSUE_SENDGRID_TEMPLATE_ID: process.env.REPORT_ISSUE_SENDGRID_TEMPLATE_ID,
166172
// SendGrid email template ID for requesting extension
@@ -268,5 +274,7 @@ module.exports = {
268274
RESOURCE_BOOKING_EXPIRY_TIME: process.env.RESOURCE_BOOKING_EXPIRY_TIME || 'P21D',
269275
// The Stripe
270276
STRIPE_SECRET_KEY: process.env.STRIPE_SECRET_KEY,
271-
CURRENCY: process.env.CURRENCY || 'usd'
277+
CURRENCY: process.env.CURRENCY || 'usd',
278+
// The slack webhook url to send slack notifications
279+
SLACK_WEBHOOK_URL: process.env.SLACK_WEBHOOK_URL
272280
}

config/email_template.config.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,41 @@ module.exports = {
159159
recipients: [],
160160
from: config.NOTIFICATION_SENDER_EMAIL,
161161
sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID
162+
},
163+
'taas.notification.team-created': {
164+
subject: 'Topcoder - Team Created',
165+
body: '',
166+
recipients: [],
167+
from: config.NOTIFICATION_SENDER_EMAIL,
168+
sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID
169+
},
170+
'taas.notification.job-created': {
171+
subject: 'Topcoder - Job Created',
172+
body: '',
173+
recipients: [],
174+
from: config.NOTIFICATION_SENDER_EMAIL,
175+
sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID
176+
},
177+
'taas.notification.interviews-overlapping': {
178+
subject: 'Topcoder - Interviews overlapping',
179+
body: '',
180+
recipients: config.NOTIFICATION_OPS_EMAILS,
181+
from: config.NOTIFICATION_SENDER_EMAIL,
182+
sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID
183+
},
184+
'taas.notification.job-candidate-selected': {
185+
subject: 'Topcoder - Job Candidate Selected',
186+
body: '',
187+
recipients: config.NOTIFICATION_OPS_EMAILS,
188+
from: config.NOTIFICATION_SENDER_EMAIL,
189+
sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID
190+
},
191+
'taas.notification.resource-booking-placed': {
192+
subject: 'Topcoder - Resource Booking Placed',
193+
body: '',
194+
recipients: [],
195+
from: config.NOTIFICATION_SENDER_EMAIL,
196+
sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID
162197
}
163198
}
164199
}

data/notifications-email-template.html

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,103 @@
240240
{{/each}}
241241
</table>
242242
{{/if}}
243+
243244
{{#if notificationType.jobCandidateResumeViewed}}
244245
Hi {{jobCandidateUserHandle}}. <br/> </br>
245246

246247
Your resume for the job "{{jobName}}" has been viewed by the client. <br/>
247248
{{/if}}
249+
250+
{{#if notificationType.newTeamCreated}}
251+
<span style="font-weight:bold;">Team:</span>
252+
<a href={{teamUrl}} target="_blank" rel="noopener noreferrer">{{teamName}}</a>
253+
<table style="font-size:13px;border:1px solid black;border-collapse:collapse;width:95%;">
254+
<tr style="font-weight:bold;border:1px solid black;border-collapse:collapse">
255+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Job Title</td>
256+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Job Start Date</td>
257+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Job Duration</td>
258+
</tr>
259+
{{#each jobList}}
260+
<tr>
261+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;"><a href={{this.jobUrl}} target="_blank" rel="noopener noreferrer">{{this.title}}</a></td>
262+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">{{this.startDate}}</td>
263+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">{{this.duration}}</td>
264+
</tr>
265+
{{/each}}
266+
</table>
267+
{{/if}}
268+
{{#if notificationType.newJobCreated}}
269+
<table style="font-size:13px;border:1px solid black;border-collapse:collapse;width:95%;">
270+
<tr style="font-weight:bold;border:1px solid black;border-collapse:collapse">
271+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Team Name</td>
272+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Job Title</td>
273+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Job Start Date</td>
274+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Job Duration</td>
275+
</tr>
276+
<tr>
277+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;"><a href={{teamURL}} target="_blank" rel="noopener noreferrer">{{teamName}}</a></td>
278+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;"><a href={{jobURL}} target="_blank" rel="noopener noreferrer">{{jobTitle}}</a></td>
279+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">{{jobStartDate}}</td>
280+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">{{jobDuration}}</td>
281+
</tr>
282+
</table>
283+
{{/if}}
284+
{{#if notificationType.overlappingInterview}}
285+
<table style="font-size:13px;border:1px solid black;border-collapse:collapse;width:95%;">
286+
<tr style="font-weight:bold;border:1px solid black;border-collapse:collapse">
287+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Team Name</td>
288+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Job Title</td>
289+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Job Candidate</td>
290+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Interview Start Date</td>
291+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Interview End Date</td>
292+
</tr>
293+
{{#each interviews}}
294+
<tr>
295+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;"><a href={{this.teamURL}} target="_blank" rel="noopener noreferrer">{{this.teamName}}</a></td>
296+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;"><a href={{this.jobURL}} target="_blank" rel="noopener noreferrer">{{this.jobTitle}}</a></td>
297+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">{{this.candidateUserHandle}}</td>
298+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">{{this.startTime}}</td>
299+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">{{this.endTime}}</td>
300+
</tr>
301+
{{/each}}
302+
</table>
303+
{{/if}}
304+
{{#if notificationType.candidateSelected}}
305+
<table style="font-size:13px;border:1px solid black;border-collapse:collapse;width:95%;">
306+
<tr style="font-weight:bold;border:1px solid black;border-collapse:collapse">
307+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Team Name</td>
308+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Job Title</td>
309+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Job Start Date</td>
310+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Job Duration</td>
311+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Job Candidate</td>
312+
</tr>
313+
<tr>
314+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;"><a href={{teamUrl}} target="_blank" rel="noopener noreferrer">{{teamName}}</a></td>
315+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;"><a href={{jobUrl}} target="_blank" rel="noopener noreferrer">{{jobTitle}}</a></td>
316+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">{{jobStartDate}}</td>
317+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">{{jobDuration}}</td>
318+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">{{userHandle}}</td>
319+
</tr>
320+
</table>
321+
{{/if}}
322+
{{#if notificationType.resourceBookingPlaced}}
323+
<table style="font-size:13px;border:1px solid black;border-collapse:collapse;width:95%;">
324+
<tr style="font-weight:bold;border:1px solid black;border-collapse:collapse">
325+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Team Name</td>
326+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Job Title</td>
327+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Resource Booking Handle</td>
328+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Resource Booking Start Date</td>
329+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Resource Booking End Date</td>
330+
</tr>
331+
<tr>
332+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;"><a href={{teamUrl}} target="_blank" rel="noopener noreferrer">{{teamName}}</a></td>
333+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;"><a href={{jobUrl}} target="_blank" rel="noopener noreferrer">{{jobTitle}}</a></td>
334+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">{{userHandle}}</td>
335+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">{{startDate}}</td>
336+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">{{endDate}}</td>
337+
</tr>
338+
</table>
339+
{{/if}}
248340

249341
<br/>
250342
If you have any questions about this process or if you encounter any issues coordinating your availability, you may reply to this email or send a separate email to <a href="mailto:talent@topcoder.com">our Gig Work operations team</a>.

0 commit comments

Comments
 (0)