|
6 | 6 | const config = require('config')
|
7 | 7 |
|
8 | 8 | module.exports = {
|
9 |
| - /* Report a general issue for a team. |
10 |
| - * |
11 |
| - * - projectId: the project ID. Example: 123412 |
12 |
| - * - projectName: the project name. Example: "TaaS API Misc Updates" |
13 |
| - * - reportText: the body of reported issue. Example: "I have issue with ... \n ... Thank you in advance!" |
| 9 | + /** |
| 10 | + * List all the kind of emails which could be sent by the endpoint `POST /taas-teams/email` inside `teamTemplates`. |
14 | 11 | */
|
15 |
| - 'team-issue-report': { |
16 |
| - subject: 'Issue Reported on TaaS Team {{projectName}} ({{projectId}}).', |
17 |
| - body: 'Project Name: {{projectName}}' + '\n' + |
18 |
| - 'Project ID: {{projectId}}' + '\n' + |
19 |
| - `Project URL: ${config.TAAS_APP_URL}/{{projectId}}` + '\n' + |
20 |
| - '\n' + |
21 |
| - '{{reportText}}', |
22 |
| - recipients: config.REPORT_ISSUE_EMAILS, |
23 |
| - sendgridTemplateId: config.REPORT_ISSUE_SENDGRID_TEMPLATE_ID |
24 |
| - }, |
| 12 | + teamTemplates: { |
| 13 | + /* Report a general issue for a team. |
| 14 | + * |
| 15 | + * - projectId: the project ID. Example: 123412 |
| 16 | + * - projectName: the project name. Example: "TaaS API Misc Updates" |
| 17 | + * - reportText: the body of reported issue. Example: "I have issue with ... \n ... Thank you in advance!" |
| 18 | + */ |
| 19 | + 'team-issue-report': { |
| 20 | + subject: 'Issue Reported on TaaS Team {{projectName}} ({{projectId}}).', |
| 21 | + body: 'Project Name: {{projectName}}' + '\n' + |
| 22 | + 'Project ID: {{projectId}}' + '\n' + |
| 23 | + `Project URL: ${config.TAAS_APP_URL}/{{projectId}}` + '\n' + |
| 24 | + '\n' + |
| 25 | + '{{reportText}}', |
| 26 | + recipients: config.REPORT_ISSUE_EMAILS, |
| 27 | + sendgridTemplateId: config.REPORT_ISSUE_SENDGRID_TEMPLATE_ID |
| 28 | + }, |
25 | 29 |
|
26 |
| - /* Report issue for a particular member |
27 |
| - * |
28 |
| - * - userHandle: the user handle. Example: "bili_2021" |
29 |
| - * - projectId: the project ID. Example: 123412 |
30 |
| - * - projectName: the project name. Example: "TaaS API Misc Updates" |
31 |
| - * - reportText: the body of reported issue. Example: "I have issue with ... \n ... Thank you in advance!" |
32 |
| - */ |
33 |
| - 'member-issue-report': { |
34 |
| - subject: 'Issue Reported for member {{userHandle}} on TaaS Team {{projectName}} ({{projectId}}).', |
35 |
| - body: 'User Handle: {{userHandle}}' + '\n' + |
36 |
| - 'Project Name: {{projectName}}' + '\n' + |
37 |
| - 'Project ID: {{projectId}}' + '\n' + |
38 |
| - `Project URL: ${config.TAAS_APP_URL}/{{projectId}}` + '\n' + |
39 |
| - '\n' + |
40 |
| - '{{reportText}}', |
41 |
| - recipients: config.REPORT_ISSUE_EMAILS, |
42 |
| - sendgridTemplateId: config.REPORT_ISSUE_SENDGRID_TEMPLATE_ID |
43 |
| - }, |
| 30 | + /* Report issue for a particular member |
| 31 | + * |
| 32 | + * - userHandle: the user handle. Example: "bili_2021" |
| 33 | + * - projectId: the project ID. Example: 123412 |
| 34 | + * - projectName: the project name. Example: "TaaS API Misc Updates" |
| 35 | + * - reportText: the body of reported issue. Example: "I have issue with ... \n ... Thank you in advance!" |
| 36 | + */ |
| 37 | + 'member-issue-report': { |
| 38 | + subject: 'Issue Reported for member {{userHandle}} on TaaS Team {{projectName}} ({{projectId}}).', |
| 39 | + body: 'User Handle: {{userHandle}}' + '\n' + |
| 40 | + 'Project Name: {{projectName}}' + '\n' + |
| 41 | + 'Project ID: {{projectId}}' + '\n' + |
| 42 | + `Project URL: ${config.TAAS_APP_URL}/{{projectId}}` + '\n' + |
| 43 | + '\n' + |
| 44 | + '{{reportText}}', |
| 45 | + recipients: config.REPORT_ISSUE_EMAILS, |
| 46 | + sendgridTemplateId: config.REPORT_ISSUE_SENDGRID_TEMPLATE_ID |
| 47 | + }, |
44 | 48 |
|
45 |
| - /* Request extension for a particular member |
46 |
| - * |
47 |
| - * - userHandle: the user handle. Example: "bili_2021" |
48 |
| - * - projectId: the project ID. Example: 123412 |
49 |
| - * - projectName: the project name. Example: "TaaS API Misc Updates" |
50 |
| - * - text: comment for the request. Example: "I would like to keep working with this member for 2 months..." |
51 |
| - */ |
52 |
| - 'extension-request': { |
53 |
| - subject: 'Extension Requested for member {{userHandle}} on TaaS Team {{projectName}} ({{projectId}}).', |
54 |
| - body: 'User Handle: {{userHandle}}' + '\n' + |
55 |
| - 'Project Name: {{projectName}}' + '\n' + |
56 |
| - 'Project ID: {{projectId}}' + '\n' + |
57 |
| - `Project URL: ${config.TAAS_APP_URL}/{{projectId}}` + '\n' + |
58 |
| - '\n' + |
59 |
| - '{{text}}', |
60 |
| - recipients: config.REPORT_ISSUE_EMAILS, |
61 |
| - sendgridTemplateId: config.REQUEST_EXTENSION_SENDGRID_TEMPLATE_ID |
| 49 | + /* Request extension for a particular member |
| 50 | + * |
| 51 | + * - userHandle: the user handle. Example: "bili_2021" |
| 52 | + * - projectId: the project ID. Example: 123412 |
| 53 | + * - projectName: the project name. Example: "TaaS API Misc Updates" |
| 54 | + * - text: comment for the request. Example: "I would like to keep working with this member for 2 months..." |
| 55 | + */ |
| 56 | + 'extension-request': { |
| 57 | + subject: 'Extension Requested for member {{userHandle}} on TaaS Team {{projectName}} ({{projectId}}).', |
| 58 | + body: 'User Handle: {{userHandle}}' + '\n' + |
| 59 | + 'Project Name: {{projectName}}' + '\n' + |
| 60 | + 'Project ID: {{projectId}}' + '\n' + |
| 61 | + `Project URL: ${config.TAAS_APP_URL}/{{projectId}}` + '\n' + |
| 62 | + '\n' + |
| 63 | + '{{text}}', |
| 64 | + recipients: config.REPORT_ISSUE_EMAILS, |
| 65 | + sendgridTemplateId: config.REQUEST_EXTENSION_SENDGRID_TEMPLATE_ID |
| 66 | + }, |
| 67 | + |
| 68 | + /* Request interview for a job candidate |
| 69 | + * |
| 70 | + * - interviewType: the x.ai interview type. Example: "interview-30" |
| 71 | + * - interviewRound: the round of the interview. Example: 2 |
| 72 | + * - interviewDuration: duration of the interview, in minutes. Example: 30 |
| 73 | + * - interviewerList: The list of interviewer email addresses. Example: "first@attendee.com, second@attendee.com" |
| 74 | + * - candidateId: the id of the jobCandidate. Example: "cc562545-7b75-48bf-87e7-50b3c57e41b1" |
| 75 | + * - candidateName: Full name of candidate. Example: "John Doe" |
| 76 | + * - jobName: The title of the job. Example: "TaaS API Misc Updates" |
| 77 | + * |
| 78 | + * Template (defined in SendGrid): |
| 79 | + * Subject: '{{interviewType}} tech interview with {{candidateName}} for {{jobName}} is requested by the Customer' |
| 80 | + * Body: |
| 81 | + * 'Hello! |
| 82 | + * <br /><br /> |
| 83 | + * Congratulations, you have been selected to participate in a Topcoder Gig Work Interview! |
| 84 | + * <br /><br /> |
| 85 | + * Please monitor your email for a response to this where you can coordinate your availability. |
| 86 | + * <br /><br /> |
| 87 | + * Interviewee: {{candidateName}}<br /> |
| 88 | + * Interviewer(s): {{interviewerList}}<br /> |
| 89 | + * Interview Length: {{interviewDuration}} minutes |
| 90 | + * <br /><br /> |
| 91 | + * /{{interviewType}} |
| 92 | + * <br /><br /> |
| 93 | + * Topcoder Info:<br /> |
| 94 | + * Note: "id: {{candidateId}}, round: {{interviewRound}}"' |
| 95 | + * |
| 96 | + * Note, that the template should be defined in SendGrid. |
| 97 | + * The subject & body above (identical to actual SendGrid template) is for reference purposes. |
| 98 | + * We won't pass subject & body but only substitutions (replacements in template subject/body). |
| 99 | + */ |
| 100 | + 'interview-invitation': { |
| 101 | + subject: '', |
| 102 | + body: '', |
| 103 | + from: config.INTERVIEW_INVITATION_SENDER_EMAIL, |
| 104 | + cc: config.INTERVIEW_INVITATION_CC_LIST, |
| 105 | + recipients: config.INTERVIEW_INVITATION_RECIPIENTS_LIST, |
| 106 | + sendgridTemplateId: config.INTERVIEW_INVITATION_SENDGRID_TEMPLATE_ID |
| 107 | + } |
62 | 108 | },
|
63 | 109 |
|
64 |
| - /* Request interview for a job candidate |
65 |
| - * |
66 |
| - * - interviewType: the x.ai interview type. Example: "interview-30" |
67 |
| - * - interviewRound: the round of the interview. Example: 2 |
68 |
| - * - interviewDuration: duration of the interview, in minutes. Example: 30 |
69 |
| - * - interviewerList: The list of interviewer email addresses. Example: "first@attendee.com, second@attendee.com" |
70 |
| - * - candidateId: the id of the jobCandidate. Example: "cc562545-7b75-48bf-87e7-50b3c57e41b1" |
71 |
| - * - candidateName: Full name of candidate. Example: "John Doe" |
72 |
| - * - jobName: The title of the job. Example: "TaaS API Misc Updates" |
73 |
| - * |
74 |
| - * Template (defined in SendGrid): |
75 |
| - * Subject: '{{interviewType}} tech interview with {{candidateName}} for {{jobName}} is requested by the Customer' |
76 |
| - * Body: |
77 |
| - * 'Hello! |
78 |
| - * <br /><br /> |
79 |
| - * Congratulations, you have been selected to participate in a Topcoder Gig Work Interview! |
80 |
| - * <br /><br /> |
81 |
| - * Please monitor your email for a response to this where you can coordinate your availability. |
82 |
| - * <br /><br /> |
83 |
| - * Interviewee: {{candidateName}}<br /> |
84 |
| - * Interviewer(s): {{interviewerList}}<br /> |
85 |
| - * Interview Length: {{interviewDuration}} minutes |
86 |
| - * <br /><br /> |
87 |
| - * /{{interviewType}} |
88 |
| - * <br /><br /> |
89 |
| - * Topcoder Info:<br /> |
90 |
| - * Note: "id: {{candidateId}}, round: {{interviewRound}}"' |
91 |
| - * |
92 |
| - * Note, that the template should be defined in SendGrid. |
93 |
| - * The subject & body above (identical to actual SendGrid template) is for reference purposes. |
94 |
| - * We won't pass subject & body but only substitutions (replacements in template subject/body). |
| 110 | + /** |
| 111 | + * List all kind of emails which could be send as Email Notifications by scheduler, API endpoints or anything else. |
95 | 112 | */
|
96 |
| - 'interview-invitation': { |
97 |
| - subject: '', |
98 |
| - body: '', |
99 |
| - from: config.INTERVIEW_INVITATION_SENDER_EMAIL, |
100 |
| - cc: config.INTERVIEW_INVITATION_CC_LIST, |
101 |
| - recipients: config.INTERVIEW_INVITATION_RECIPIENTS_LIST, |
102 |
| - sendgridTemplateId: config.INTERVIEW_INVITATION_SENDGRID_TEMPLATE_ID |
| 113 | + notificationEmailTemplates: { |
| 114 | + 'taas.notification.candidates-available-for-review': { |
| 115 | + subject: 'Topcoder - {{teamName}} has job candidates available for review', |
| 116 | + body: '', |
| 117 | + recipients: [], |
| 118 | + from: config.NOTIFICATION_SENDER_EMAIL, |
| 119 | + sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID |
| 120 | + }, |
| 121 | + 'taas.notification.interview-coming-up-host': { |
| 122 | + subject: 'Topcoder - Interview Coming Up: {{jobTitle}} with {{guestFullName}}', |
| 123 | + body: '', |
| 124 | + recipients: [], |
| 125 | + from: config.NOTIFICATION_SENDER_EMAIL, |
| 126 | + sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID |
| 127 | + }, |
| 128 | + 'taas.notification.interview-coming-up-guest': { |
| 129 | + subject: 'Topcoder - Interview Coming Up: {{jobTitle}} with {{hostFullName}}', |
| 130 | + body: '', |
| 131 | + recipients: [], |
| 132 | + from: config.NOTIFICATION_SENDER_EMAIL, |
| 133 | + sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID |
| 134 | + }, |
| 135 | + 'taas.notification.interview-awaits-resolution': { |
| 136 | + subject: 'Topcoder - Interview Awaits Resolution: {{jobTitle}} for {{guestFullName}}', |
| 137 | + body: '', |
| 138 | + recipients: [], |
| 139 | + from: config.NOTIFICATION_SENDER_EMAIL, |
| 140 | + sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID |
| 141 | + }, |
| 142 | + 'taas.notification.post-interview-action-required': { |
| 143 | + subject: 'Topcoder - Candidate Action Required in {{teamName}} for {{numCandidates}} candidates', |
| 144 | + body: '', |
| 145 | + recipients: [], |
| 146 | + from: config.NOTIFICATION_SENDER_EMAIL, |
| 147 | + sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID |
| 148 | + }, |
| 149 | + 'taas.notification.resource-booking-expiration': { |
| 150 | + subject: 'Topcoder - Resource Booking Expiring in {{teamName}} for {{numResourceBookings}} resource bookings', |
| 151 | + body: '', |
| 152 | + recipients: [], |
| 153 | + from: config.NOTIFICATION_SENDER_EMAIL, |
| 154 | + sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID |
| 155 | + } |
103 | 156 | }
|
104 | 157 | }
|
0 commit comments