Skip to content

Commit 06c8fd1

Browse files
committed
1 parent eefcbbb commit 06c8fd1

File tree

3 files changed

+53
-34
lines changed

3 files changed

+53
-34
lines changed

data/notification-email-templates/taas.notification.interview-coming-up-guest.html

+10-1
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,17 @@
9696
<td
9797
style="color:#151516;font-size:13px;line-height:20px;margin:0;padding:0;vertical-align:middle">
9898
<br/>
99-
You have an interview coming up for a Topcoder gig! See the job and get the meeting link <a href={{interviewLink}} target="_blank" rel="noopener noreferrer">here</a>.
99+
You have an interview coming up for a Topcoder gig!
100100
<br/>
101+
<br/>
102+
<div><strong>Job: </strong><span>{{this.jobTitle}}</span></div>
103+
<div><strong>Interviewer: </strong><span>{{this.host}}</span></div>
104+
<div><strong>Zoom link: </strong> <span>
105+
<a href="{{this.zoomLink}}" target="_blank" rel="noopener noreferrer">zoom link</a>
106+
</span></div>
107+
<div><strong>Start: </strong><span>{{this.start}}</span></div>
108+
<div><strong>End: </strong><span>{{this.end}}</span></div>
109+
<div><strong>Timezone: </strong><span>{{this.guestTimezone}}</span></div>
101110
<br/>
102111
If you’re signed in to your Topcoder account, you can also find this information on the My Gigs <a href={{applicationUrl}} target="_blank" rel="noopener noreferrer">Applications</a> page.
103112

data/notification-email-templates/taas.notification.interview-coming-up-host.html

+18-29
Original file line numberDiff line numberDiff line change
@@ -102,35 +102,24 @@
102102
This is your reminder that you have an interview coming up with an awesome Topcoder freelance candidate. Click the link below to review their resume and profile before the big event.
103103
<br/>
104104
<br/>
105-
<table style="font-size:13px;border:1px solid black;border-collapse:collapse;width:100%;">
106-
<tr style="font-weight:bold;border:1px solid black;border-collapse:collapse">
107-
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Job title</td>
108-
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Candidate Handle</td>
109-
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Interviews</td>
110-
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">Date and Time</td>
111-
</tr>
112-
<tr>
113-
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">
114-
<a href={{this.jobUrl}} target="_blank" rel="noopener noreferrer">{{this.jobTitle}}</a>
115-
</td>
116-
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">{{this.handle}}</td>
117-
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">
118-
<a href={{this.interviewLink}} target="_blank" rel="noopener noreferrer">Link</a></td>
119-
<td style="border:1px solid black;border-collapse:collapse;text-align:center;line-height:1.5;">{{this.startTime}}</td>
120-
</tr>
121-
</table>
122-
123-
<br/>
124-
<a href={{this.interviewLink}} target="_blank" rel="noopener noreferrer">Candidate resume and profile</a>
125-
<p>Can’t wait to hear how it goes,<br/>
126-
The Topcoder Team
127-
</p>
128-
</td>
129-
<td
130-
style="color:#151516;font-size:13px;height:20px;line-height:20px;margin:0;padding:0;vertical-align:middle;width:20px">
131-
</td>
132-
</tr>
133-
105+
<div><strong>Job: </strong><span>{{this.jobTitle}}</span></div>
106+
<div><strong>Interviewer: </strong><span>{{this.guest}}</span></div>
107+
<div><strong>Zoom link: </strong> <span>
108+
<a href="{{this.zoomLink}}" target="_blank" rel="noopener noreferrer">zoom link</a>
109+
</span></div>
110+
<div><strong>Start: </strong><span>{{this.start}}</span></div>
111+
<div><strong>End: </strong><span>{{this.end}}</span></div>
112+
<div><strong>Timezone: </strong><span>{{this.hostTimezone}}</span></div>
113+
<br/>
114+
<a href={{this.interviewLink}} target="_blank" rel="noopener noreferrer">Candidate resume and profile</a>
115+
<p>Can’t wait to hear how it goes,<br/>
116+
The Topcoder Team
117+
</p>
118+
</td>
119+
<td
120+
style="color:#151516;font-size:13px;height:20px;line-height:20px;margin:0;padding:0;vertical-align:middle;width:20px">
121+
</td>
122+
</tr>
134123
</tbody>
135124
</table>
136125
</td>

src/services/NotificationsSchedulerService.js

+25-4
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,25 @@ async function sendInterviewComingUpNotifications () {
275275
const data = await getDataForInterview(interview)
276276
if (!data) { continue }
277277

278+
const TIME_FORMAT = 'dddd MMM. Do, hh:mm a'
279+
const hostZoomToken = helper.signZoomLink({ type: constants.ZoomLinkType.HOST, id: interview.id })
280+
const hostZoomLink = `${config.TAAS_API_BASE_URL}/getInterview/${interview.id}/zoom-link?type=${constants.ZoomLinkType.HOST}&token=${hostZoomToken}`
281+
282+
const guestZoomToken = helper.signZoomLink({ type: constants.ZoomLinkType.GUEST, id: interview.id })
283+
const guestZoomLink = `${config.TAAS_API_BASE_URL}/getInterview/${interview.id}/zoom-link?type=${constants.ZoomLinkType.GUEST}&token=${guestZoomToken}`
278284
if (!_.isEmpty(data.hostEmail)) {
279-
data.startTime = formatInterviewTime(interview, { forInterviewHost: true })
280285
sendNotification({}, {
281286
template: 'taas.notification.interview-coming-up-host',
282287
recipients: [{ email: data.hostEmail }],
283-
data
288+
data: {
289+
guest: data.guestFullName,
290+
jobTitle: data.jobTitle,
291+
zoomLink: hostZoomLink,
292+
start: moment(interview.startTimestamp).tz(interview.hostTimezone).format(TIME_FORMAT) + ` ${interview.hostTimezone}`,
293+
end: moment(interview.endTimestamp).tz(interview.hostTimezone).format(TIME_FORMAT) + ` ${interview.hostTimezone}`,
294+
hostTimezone: interview.hostTimezone,
295+
interviewLink: data.interviewLink
296+
}
284297
})
285298

286299
sentHostCount++
@@ -289,12 +302,20 @@ async function sendInterviewComingUpNotifications () {
289302
}
290303

291304
if (!_.isEmpty(data.guestEmail)) {
292-
data.startTime = formatInterviewTime(interview, { forInterviewGuest: true })
305+
// fallback to host timezone if by some reason we didn't obtain guest timezone
306+
const guestTimezone = interview.guestTimezone || interview.hostTimezone
293307
// send guest emails
294308
sendNotification({}, {
295309
template: 'taas.notification.interview-coming-up-guest',
296310
recipients: [{ email: data.guestEmail }],
297-
data
311+
data: {
312+
host: data.hostFullName,
313+
jobTitle: data.jobTitle,
314+
zoomLink: guestZoomLink,
315+
start: moment(interview.startTimestamp).tz(guestTimezone).format(TIME_FORMAT) + ` ${guestTimezone}`,
316+
end: moment(interview.endTimestamp).tz(guestTimezone).format(TIME_FORMAT) + ` ${guestTimezone}`,
317+
guestTimezone
318+
}
298319
})
299320

300321
sentGuestCount++

0 commit comments

Comments
 (0)