Skip to content

Commit 3826c98

Browse files
authored
Merge pull request #482 from xxcxy/feature/notifications-api
imp API Triggered Notifications
2 parents cc75599 + b6bff7e commit 3826c98

17 files changed

+936
-40
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
@@ -152,6 +152,41 @@ module.exports = {
152152
recipients: [],
153153
from: config.NOTIFICATION_SENDER_EMAIL,
154154
sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID
155+
},
156+
'taas.notification.team-created': {
157+
subject: 'Topcoder - Team Created',
158+
body: '',
159+
recipients: [],
160+
from: config.NOTIFICATION_SENDER_EMAIL,
161+
sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID
162+
},
163+
'taas.notification.job-created': {
164+
subject: 'Topcoder - Job Created',
165+
body: '',
166+
recipients: [],
167+
from: config.NOTIFICATION_SENDER_EMAIL,
168+
sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID
169+
},
170+
'taas.notification.interviews-overlapping': {
171+
subject: 'Topcoder - Interviews overlapping',
172+
body: '',
173+
recipients: config.NOTIFICATION_OPS_EMAILS,
174+
from: config.NOTIFICATION_SENDER_EMAIL,
175+
sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID
176+
},
177+
'taas.notification.job-candidate-selected': {
178+
subject: 'Topcoder - Job Candidate Selected',
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.resource-booking-placed': {
185+
subject: 'Topcoder - Resource Booking Placed',
186+
body: '',
187+
recipients: [],
188+
from: config.NOTIFICATION_SENDER_EMAIL,
189+
sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID
155190
}
156191
}
157192
}

data/notifications-email-template.html

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,96 @@
240240
{{/each}}
241241
</table>
242242
{{/if}}
243+
{{#if notificationType.newTeamCreated}}
244+
<span style="font-weight:bold;">Team Name:</span>
245+
<a href={{teamURL}} target="_blank" rel="noopener noreferrer">{{teamName}}</a>
246+
<table style="font-size:13px;border:1px solid black;border-collapse:collapse;width:95%;">
247+
<tr style="font-weight:bold;border:1px solid black;border-collapse:collapse">
248+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Job Title</td>
249+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Duration</td>
250+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Start Date</td>
251+
</tr>
252+
{{#each jobList}}
253+
<tr>
254+
<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>
255+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">{{this.duration}}</td>
256+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">{{this.startDate}}</td>
257+
</tr>
258+
{{/each}}
259+
</table>
260+
{{/if}}
261+
{{#if notificationType.newJobCreated}}
262+
<table style="font-size:13px;border:1px solid black;border-collapse:collapse;width:95%;">
263+
<tr style="font-weight:bold;border:1px solid black;border-collapse:collapse">
264+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Team Name</td>
265+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Job title</td>
266+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Duration</td>
267+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Start Date</td>
268+
</tr>
269+
<tr>
270+
<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>
271+
<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>
272+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">{{jobDuration}}</td>
273+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">{{jobStartDate}}</td>
274+
</tr>
275+
</table>
276+
{{/if}}
277+
{{#if notificationType.overlappingInterview}}
278+
<table style="font-size:13px;border:1px solid black;border-collapse:collapse;width:95%;">
279+
<tr style="font-weight:bold;border:1px solid black;border-collapse:collapse">
280+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Team Name</td>
281+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Job title</td>
282+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Job Candidate</td>
283+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Interview Start Date</td>
284+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Interview End Date</td>
285+
</tr>
286+
{{#each interviews}}
287+
<tr>
288+
<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>
289+
<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>
290+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">{{this.candidateUserHandle}}</td>
291+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">{{this.startTime}}</td>
292+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">{{this.endTime}}</td>
293+
</tr>
294+
{{/each}}
295+
</table>
296+
{{/if}}
297+
{{#if notificationType.candidateSelected}}
298+
<table style="font-size:13px;border:1px solid black;border-collapse:collapse;width:95%;">
299+
<tr style="font-weight:bold;border:1px solid black;border-collapse:collapse">
300+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Team Name</td>
301+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Job title</td>
302+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Job Start Date</td>
303+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Job Duration</td>
304+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Candidate User Handle</td>
305+
</tr>
306+
<tr>
307+
<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>
308+
<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>
309+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">{{jobStartDate}}</td>
310+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">{{jobDuration}}</td>
311+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">{{userHandle}}</td>
312+
</tr>
313+
</table>
314+
{{/if}}
315+
{{#if notificationType.resourceBookingPlaced}}
316+
<table style="font-size:13px;border:1px solid black;border-collapse:collapse;width:95%;">
317+
<tr style="font-weight:bold;border:1px solid black;border-collapse:collapse">
318+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Team Name</td>
319+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Job Title</td>
320+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Resource Bookings Handle</td>
321+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Resource Bookings Start Date</td>
322+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Resource Bookings End Date</td>
323+
</tr>
324+
<tr>
325+
<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>
326+
<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>
327+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">{{userHandle}}</td>
328+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">{{startDate}}</td>
329+
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">{{endDate}}</td>
330+
</tr>
331+
</table>
332+
{{/if}}
243333

244334
<br/>
245335
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)