From 726e762047debdc509931c921ea6c15cd8360e31 Mon Sep 17 00:00:00 2001 From: xxcxy Date: Wed, 1 Sep 2021 12:57:27 +0800 Subject: [PATCH 1/3] Split email template and update text --- config/default.js | 20 ++ config/email_template.config.js | 40 +-- ...e-was-viewed-by-client-email-template.html | 246 ++++++++++++++++ ...e-available-for-review-email-template.html | 268 +++++++++++++++++ ...er-interview-coming-up-email-template.html | 270 ++++++++++++++++++ data/interview-completed-email-template.html | 270 ++++++++++++++++++ ...rs-interview-coming-up-email-template.html | 244 ++++++++++++++++ ...ed-to-existing-project-email-template.html | 256 +++++++++++++++++ data/new-team-created-email-template.html | 256 +++++++++++++++++ data/notifications-email-template.html | 213 -------------- ...erview-action-reminder-email-template.html | 269 +++++++++++++++++ data/resource-placed-email-template.html | 258 +++++++++++++++++ ...rce-booking-expiration-email-template.html | 263 +++++++++++++++++ scripts/demo-email-notifications/index.js | 15 +- 14 files changed, 2653 insertions(+), 235 deletions(-) create mode 100644 data/candidate-was-viewed-by-client-email-template.html create mode 100644 data/candidates-are-available-for-review-email-template.html create mode 100644 data/customer-interview-coming-up-email-template.html create mode 100644 data/interview-completed-email-template.html create mode 100644 data/members-interview-coming-up-email-template.html create mode 100644 data/new-job-added-to-existing-project-email-template.html create mode 100644 data/new-team-created-email-template.html create mode 100644 data/post-interview-action-reminder-email-template.html create mode 100644 data/resource-placed-email-template.html create mode 100644 data/upcoming-resource-booking-expiration-email-template.html diff --git a/config/default.js b/config/default.js index e3dc3cf8..7ba05ecc 100644 --- a/config/default.js +++ b/config/default.js @@ -253,6 +253,26 @@ module.exports = { NOTIFICATION_SENDER_EMAIL: process.env.NOTIFICATION_SENDER_EMAIL || 'noreply@topcoder.com', // the email notification sendgrid template id NOTIFICATION_SENDGRID_TEMPLATE_ID: process.env.NOTIFICATION_SENDGRID_TEMPLATE_ID, + // the email notification sendgrid template id of candidate was viewed by client + NOTIFICATION_CLIENT_VIEWED_PROFILE_SENDGRID_TEMPLATE_ID: process.env.NOTIFICATION_CLIENT_VIEWED_PROFILE_SENDGRID_TEMPLATE_ID, + // the email notification sendgrid template id of candidates are available for review + NOTIFICATION_REVIEW_CANDIDATES_SENDGRID_TEMPLATE_ID: process.env.NOTIFICATION_REVIEW_CANDIDATES_SENDGRID_TEMPLATE_ID, + // the email notification sendgrid template id of interview coming up for customer + NOTIFICATION_CUSTOMER_INTERVIEW_COMING_UP_SENDGRID_TEMPLATE_ID: process.env.NOTIFICATION_CUSTOMER_INTERVIEW_COMING_UP_SENDGRID_TEMPLATE_ID, + // the email notification sendgrid template id of interview coming up for member + NOTIFICATION_MEMBER_INTERVIEW_COMING_UP_SENDGRID_TEMPLATE_ID: process.env.NOTIFICATION_MEMBER_INTERVIEW_COMING_UP_SENDGRID_TEMPLATE_ID, + // the email notification sendgrid template id of interview completed + NOTIFICATION_INTERVIEW_COMPLETE_SENDGRID_TEMPLATE_ID: process.env.NOTIFICATION_INTERVIEW_COMPLETE_SENDGRID_TEMPLATE_ID, + // the email notification sendgrid template id of post interview action reminder + NOTIFICATION_POST_INTERVIEW_ACTION_SENDGRID_TEMPLATE_ID: process.env.NOTIFICATION_POST_INTERVIEW_ACTION_SENDGRID_TEMPLATE_ID, + // the email notification sendgrid template id of upcoming resource booking expiration + NOTIFICATION_UPCOMING_RESOURCE_BOOKING_EXPIRATION_SENDGRID_TEMPLATE_ID: process.env.NOTIFICATION_UPCOMING_RESOURCE_BOOKING_EXPIRATION_SENDGRID_TEMPLATE_ID, + // the email notification sendgrid template id of new team created + NOTIFICATION_NEW_TEAM_CREATED_SENDGRID_TEMPLATE_ID: process.env.NOTIFICATION_NEW_TEAM_CREATED_SENDGRID_TEMPLATE_ID, + // the email notification sendgrid template id of new job added to existing project + NOTIFICATION_NEW_JOB_ADDED_SENDGRID_TEMPLATE_ID: process.env.NOTIFICATION_NEW_JOB_ADDED_SENDGRID_TEMPLATE_ID, + // the email notification sendgrid template id of resource placed + NOTIFICATION_RESOURCE_BOOKING_PLACED_SENDGRID_TEMPLATE_ID: process.env.NOTIFICATION_RESOURCE_BOOKING_PLACED_SENDGRID_TEMPLATE_ID, // frequency of cron checking for available candidates for review CRON_CANDIDATE_REVIEW: process.env.CRON_CANDIDATE_REVIEW || '00 00 13 * * 0-6', // frequency of cron checking for coming up interviews diff --git a/config/email_template.config.js b/config/email_template.config.js index 524d54f1..ebac365b 100644 --- a/config/email_template.config.js +++ b/config/email_template.config.js @@ -112,67 +112,67 @@ module.exports = { */ notificationEmailTemplates: { 'taas.notification.job-candidate-resume-viewed': { - subject: 'Topcoder - Client View Resume for Job {{jobName}}', + subject: 'Client has viewed your Topcoder profile', body: '', recipients: [], from: config.NOTIFICATION_SENDER_EMAIL, - sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID + sendgridTemplateId: config.NOTIFICATION_CLIENT_VIEWED_PROFILE_SENDGRID_TEMPLATE_ID }, 'taas.notification.candidates-available-for-review': { - subject: 'Topcoder - {{teamName}} has job candidates available for review', + subject: 'You have candidates to review', body: '', recipients: [], from: config.NOTIFICATION_SENDER_EMAIL, - sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID + sendgridTemplateId: config.NOTIFICATION_REVIEW_CANDIDATES_SENDGRID_TEMPLATE_ID }, 'taas.notification.interview-coming-up-host': { - subject: 'Topcoder - Interview Coming Up: {{jobTitle}} with {{guestFullName}}', + subject: 'Interview reminder: Your Topcoder interview is coming up', body: '', recipients: [], from: config.NOTIFICATION_SENDER_EMAIL, - sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID + sendgridTemplateId: config.NOTIFICATION_CUSTOMER_INTERVIEW_COMING_UP_SENDGRID_TEMPLATE_ID }, 'taas.notification.interview-coming-up-guest': { - subject: 'Topcoder - Interview Coming Up: {{jobTitle}} with {{hostFullName}}', + subject: 'Reminder: Interview coming up', body: '', recipients: [], from: config.NOTIFICATION_SENDER_EMAIL, - sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID + sendgridTemplateId: config.NOTIFICATION_MEMBER_INTERVIEW_COMING_UP_SENDGRID_TEMPLATE_ID }, 'taas.notification.interview-awaits-resolution': { - subject: 'Topcoder - Interview Awaits Resolution: {{jobTitle}} for {{guestFullName}}', + subject: 'Interview complete - here’s what to do next', body: '', recipients: [], from: config.NOTIFICATION_SENDER_EMAIL, - sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID + sendgridTemplateId: config.NOTIFICATION_INTERVIEW_COMPLETE_SENDGRID_TEMPLATE_ID }, 'taas.notification.post-interview-action-required': { - subject: 'Topcoder - Candidate Action Required in {{teamName}} for {{numCandidates}} candidates', + subject: 'Reminder: Take action to reserve your talent', body: '', recipients: [], from: config.NOTIFICATION_SENDER_EMAIL, - sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID + sendgridTemplateId: config.NOTIFICATION_POST_INTERVIEW_ACTION_SENDGRID_TEMPLATE_ID }, 'taas.notification.resource-booking-expiration': { - subject: 'Topcoder - Resource Booking Expiring in {{teamName}} for {{numResourceBookings}} resource bookings', + subject: 'Reminder: 3 weeks left in your Angular Developer’s gig', body: '', recipients: [], from: config.NOTIFICATION_SENDER_EMAIL, - sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID + sendgridTemplateId: config.NOTIFICATION_UPCOMING_RESOURCE_BOOKING_EXPIRATION_SENDGRID_TEMPLATE_ID }, 'taas.notification.team-created': { - subject: 'Topcoder - New Team {{teamName}} Created', + subject: 'Your Topcoder talent request confirmation', body: '', recipients: [], from: config.NOTIFICATION_SENDER_EMAIL, - sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID + sendgridTemplateId: config.NOTIFICATION_NEW_TEAM_CREATED_SENDGRID_TEMPLATE_ID }, 'taas.notification.job-created': { - subject: 'Topcoder - New Job {{jobTitle}} Created in Team {{teamName}}', + subject: 'New job added to your Topcoder team', body: '', recipients: [], from: config.NOTIFICATION_SENDER_EMAIL, - sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID + sendgridTemplateId: config.NOTIFICATION_NEW_JOB_ADDED_SENDGRID_TEMPLATE_ID }, 'taas.notification.interviews-overlapping': { subject: 'Topcoder - Interviews overlapping', @@ -189,11 +189,11 @@ module.exports = { sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID }, 'taas.notification.resource-booking-placed': { - subject: 'Topcoder - Resource Booking {{userHandle}} Placed for Job {{jobTitle}} in Team {{teamName}}', + subject: 'Your Topcoder talent is confirmed! How to start working with them.', body: '', recipients: [], from: config.NOTIFICATION_SENDER_EMAIL, - sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID + sendgridTemplateId: config.NOTIFICATION_RESOURCE_BOOKING_PLACED_SENDGRID_TEMPLATE_ID } } } diff --git a/data/candidate-was-viewed-by-client-email-template.html b/data/candidate-was-viewed-by-client-email-template.html new file mode 100644 index 00000000..968415e0 --- /dev/null +++ b/data/candidate-was-viewed-by-client-email-template.html @@ -0,0 +1,246 @@ +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + + + + + + +
IMG +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ Update on Your Application
+
+ + + + + + + + + +
IMG + Client Has Viewed Your Profile +
+
+ Thanks for applying for a Topcoder Gig. This is an update to let you know that the client has viewed your profile. We will notify you about next steps. +
+
+ + + + + + +
+ + + + + + + + +
+ +
+
+ To check the status of all your Gig Work applications, log in to your Topcoder account and head to My Gigs → Open Applications. + +
+
+ Thanks! +

+ The Topcoder Team +

+
+
+
+ + + + + + +
+
+ + + + + + +
+
+
+ + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+ + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ 201 S Capitol Ave #1100
+ Indianapolis, IN 46225 United States
+
+ ●●●
+
+ Topcoder System Information: +
+ InterviewType: {{xai_template}}
+
+ + + + + + +
+
+
diff --git a/data/candidates-are-available-for-review-email-template.html b/data/candidates-are-available-for-review-email-template.html new file mode 100644 index 00000000..bf67f268 --- /dev/null +++ b/data/candidates-are-available-for-review-email-template.html @@ -0,0 +1,268 @@ +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + + + + + + +
IMG +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ Your Candidates
+
+ + + + + + + + + +
IMG + Here are Your Candidates Awaiting Review +
+
+ You’ve matched with talent! Use the link below to review your candidates. You can schedule an interview if you want to move forward, or decline if they’re not a match. +
+
+ + + + + + +
+ + + + + + + + +
+ + + + + + + + + {{#each teamJobs}} + + + + + + + {{/each}} +
Job titleNo of resource bookingsCandidatesReview
+ {{this.title}} + {{this.nResourceBookings}} +
    + {{#each this.jobCandidates}} +
  • {{this.handle}}
  • + {{/each}} +
+
+ Link +
+ +
+ Thanks! +

+ The Topcoder Team +

+
+
+
+ + + + + + +
+
+ + + + + + +
+
+
+ + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+ + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ 201 S Capitol Ave #1100
+ Indianapolis, IN 46225 United States
+
+ ●●●
+
+ Topcoder System Information: +
+ InterviewType: {{xai_template}}
+
+ + + + + + +
+
+
diff --git a/data/customer-interview-coming-up-email-template.html b/data/customer-interview-coming-up-email-template.html new file mode 100644 index 00000000..9eaff621 --- /dev/null +++ b/data/customer-interview-coming-up-email-template.html @@ -0,0 +1,270 @@ +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + + + + + + +
IMG +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ interview Coming Up
+
+ + + + + + + + + +
IMG + Reminder: You Have an Upcoming Interview +
+
+ Ohhh the butterflies before a first date. Just kidding, this is totally professional. But meeting someone who could potentially make your life a lot easier is very exciting. +
+
+ 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. +
+
+ + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + +
Job titleCandidate HandleInterviewsAttendeesDate and Time
+ {{this.jobTitle}} + {{this.handle}} + Link +
    + {{#each this.attendees}} +
  • {{this}}
  • + {{/each}} +
+
{{this.startTime}}
+ +
+ Can’t wait to hear how it goes, +

+ The Topcoder Team +

+
+
+
+ + + + + + +
+
+ + + + + + +
+
+
+ + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+ + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ 201 S Capitol Ave #1100
+ Indianapolis, IN 46225 United States
+
+ ●●●
+
+ Topcoder System Information: +
+ InterviewType: {{xai_template}}
+
+ + + + + + +
+
+
diff --git a/data/interview-completed-email-template.html b/data/interview-completed-email-template.html new file mode 100644 index 00000000..fb352f0f --- /dev/null +++ b/data/interview-completed-email-template.html @@ -0,0 +1,270 @@ +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + + + + + + +
IMG +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ Next Steps with Your Candidate
+
+ + + + + + + + + +
IMG + Interview Complete, What To Do Next +
+
+ Thanks for taking the time to interview your candidate. We hope it went well and that they are a perfect fit. Now it’s time to take action: +
+
+ Use the link below to Accept, Decline, or schedule another interview. Don’t wait—Topcoder talent is in high-demand: +
+
+ + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + +
Job titleCandidate HandleDate and TimeAttendeesInterviews
+ {{this.jobTitle}} + {{this.handle}}{{this.startTime}} +
    + {{#each this.attendees}} +
  • {{this}}
  • + {{/each}} +
+
+ Link
+ +
+ Any issues with this interview? Please contact us here. +

Thanks!
+ The Topcoder Team +

+
+
+
+ + + + + + +
+
+ + + + + + +
+
+
+ + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+ + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ 201 S Capitol Ave #1100
+ Indianapolis, IN 46225 United States
+
+ ●●●
+
+ Topcoder System Information: +
+ InterviewType: {{xai_template}}
+
+ + + + + + +
+
+
diff --git a/data/members-interview-coming-up-email-template.html b/data/members-interview-coming-up-email-template.html new file mode 100644 index 00000000..48462061 --- /dev/null +++ b/data/members-interview-coming-up-email-template.html @@ -0,0 +1,244 @@ +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + + + + + + +
IMG +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ Reminder: Interview with Client
+
+ + + + + + + + + +
IMG + You Have an Upcoming Interview +
+
+ You have an interview coming up for a Topcoder gig! See the job and get the meeting link here. +
+
+ + + + + + +
+ + + + + + + + +
+ +
+ If you’re signed in to your Topcoder account, you can also find this information on the My Gigs Applications page. + +
+ Can’t wait to hear how it goes, +

+ The Topcoder Team +

+
+
+
+ + + + + + +
+
+ + + + + + +
+
+
+ + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+ + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ 201 S Capitol Ave #1100
+ Indianapolis, IN 46225 United States
+
+ ●●●
+
+ Topcoder System Information: +
+ InterviewType: {{xai_template}}
+
+ + + + + + +
+
+
diff --git a/data/new-job-added-to-existing-project-email-template.html b/data/new-job-added-to-existing-project-email-template.html new file mode 100644 index 00000000..4507eb84 --- /dev/null +++ b/data/new-job-added-to-existing-project-email-template.html @@ -0,0 +1,256 @@ +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + + + + + + +
IMG +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ Update
+
+ + + + + + + + + +
IMG + New Job Added to Your Team +
+
+ We’ve received your request for a new role on your team. We’ll notify you when you have a new candidate to review. You can add more roles to your team any time. +
+
+ + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + +
Team NameJob TitleJob Start DateJob Duration
{{teamName}}{{jobTitle}}{{jobStartDate}}{{jobDuration}}
+ +
+ Thanks! +

+ The Topcoder Team +

+
+
+
+ + + + + + +
+
+ + + + + + +
+
+
+ + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+ + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ 201 S Capitol Ave #1100
+ Indianapolis, IN 46225 United States
+
+ ●●●
+
+ Topcoder System Information: +
+ InterviewType: {{xai_template}}
+
+ + + + + + +
+
+
diff --git a/data/new-team-created-email-template.html b/data/new-team-created-email-template.html new file mode 100644 index 00000000..a872592a --- /dev/null +++ b/data/new-team-created-email-template.html @@ -0,0 +1,256 @@ +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + + + + + + +
IMG +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ Your Request is Confirmed
+
+ + + + + + + + + +
IMG + Talent Request Confirmed +
+
+ Congratulations! You’ve successfully submitted your talent request to Topcoder. We’ll notify you when you have a new candidate to review. You can add more roles to your team at any time. +
+
+ + + + + + +
+ + + + + + + + +
+ + + + + + + + {{#each jobList}} + + + + + + {{/each}} +
Job TitleJob Start DateJob Duration
{{this.title}}{{this.startDate}}{{this.duration}}
+ +
+ Thanks for your request. We look forward to bringing you awesome freelance talent. +

+ The Topcoder Team +

+
+
+
+ + + + + + +
+
+ + + + + + +
+
+
+ + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+ + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ 201 S Capitol Ave #1100
+ Indianapolis, IN 46225 United States
+
+ ●●●
+
+ Topcoder System Information: +
+ InterviewType: {{xai_template}}
+
+ + + + + + +
+
+
diff --git a/data/notifications-email-template.html b/data/notifications-email-template.html index f0da558d..a8befab4 100644 --- a/data/notifications-email-template.html +++ b/data/notifications-email-template.html @@ -95,202 +95,7 @@ - {{#if notificationType.candidatesAvailableForReview}} - - - - - - - - {{#each teamJobs}} - - - - - - - {{/each}} -
Job titleNo of resource bookingsCandidatesReview
- {{this.title}} - {{this.nResourceBookings}} -
    - {{#each this.jobCandidates}} -
  • {{this.handle}}
  • - {{/each}} -
-
- Link -
- {{/if}} - - {{#if notificationType.interviewComingUpForHost}} - - - - - - - - - - - - - - - -
Job titleCandidate HandleInterviewsAttendeesDate and Time
- {{this.jobTitle}} - {{this.handle}} - Link -
    - {{#each this.attendees}} -
  • {{this}}
  • - {{/each}} -
-
{{this.startTime}}
- {{/if}} - - {{#if notificationType.interviewComingUpForGuest}} - - - - - - - - - - - -
Job titleDate and TimeInterviews
- {{this.jobTitle}} - {{this.startTime}} - Link
- {{/if}} - - {{#if notificationType.interviewCompleted}} - - - - - - - - - - - - - - - -
Job titleCandidate HandleDate and TimeAttendeesInterviews
- {{this.jobTitle}} - {{this.handle}}{{this.startTime}} -
    - {{#each this.attendees}} -
  • {{this}}
  • - {{/each}} -
-
- Link
- {{/if}} - - {{#if notificationType.postInterviewCandidateAction}} - - - - - - - - - {{#each teamInterviews}} - - - - - - - - {{/each}} -
Job titleHandleDate and TimeAttendeesInterviews
- {{this.jobTitle}} - {{this.handle}}{{this.startTime}} -
    - {{#each this.attendees}} -
  • {{this}}
  • - {{/each}} -
-
- Link
- {{/if}} - - {{#if notificationType.upcomingResourceBookingExpiration}} - Team Name: - {{teamName}} - - - - - - - {{#each teamResourceBookings}} - - - - - - {{/each}} -
Job titleResource Bookings HandleEnd Date
- {{this.jobTitle}} - - {{this.handle}} - {{this.endDate}}
- {{/if}} - - {{#if notificationType.jobCandidateResumeViewed}} - Hi {{jobCandidateUserHandle}}.

- Your resume for the job "{{jobName}}" has been viewed by the client.
- {{/if}} - - {{#if notificationType.newTeamCreated}} - Team: - {{teamName}} - - - - - - - {{#each jobList}} - - - - - - {{/each}} -
Job TitleJob Start DateJob Duration
{{this.title}}{{this.startDate}}{{this.duration}}
- {{/if}} - {{#if notificationType.newJobCreated}} - - - - - - - - - - - - - -
Team NameJob TitleJob Start DateJob Duration
{{teamName}}{{jobTitle}}{{jobStartDate}}{{jobDuration}}
- {{/if}} {{#if notificationType.overlappingInterview}} @@ -329,24 +134,6 @@
{{/if}} - {{#if notificationType.resourceBookingPlaced}} - - - - - - - - - - - - - - - -
Team NameJob TitleResource Booking HandleResource Booking Start DateResource Booking End Date
{{teamName}}{{jobTitle}}{{userHandle}}{{startDate}}{{endDate}}
- {{/if}}
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 our Gig Work operations team. diff --git a/data/post-interview-action-reminder-email-template.html b/data/post-interview-action-reminder-email-template.html new file mode 100644 index 00000000..b81b261d --- /dev/null +++ b/data/post-interview-action-reminder-email-template.html @@ -0,0 +1,269 @@ +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + + + + + + +
IMG +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ Ghosting Is Not Cool
+
+ + + + + + + + + +
IMG + Take Action on This Candidate +
+
+ Use the link below to Accept, Decline, or schedule another interview with your candidate. This person might have an offer on another gig, and is awaiting your response to make a decision. Please do this now: +
+
+ + + + + + +
+ + + + + + + + +
+ + + + + + + + + + {{#each teamInterviews}} + + + + + + + + {{/each}} +
Job titleHandleDate and TimeAttendeesInterviews
+ {{this.jobTitle}} + {{this.handle}}{{this.startTime}} +
    + {{#each this.attendees}} +
  • {{this}}
  • + {{/each}} +
+
+ Link
+ +
+ Any issues? Please contact us here. +

Thanks!
+ The Topcoder Team +

+
+
+
+ + + + + + +
+
+ + + + + + +
+
+
+ + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+ + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ 201 S Capitol Ave #1100
+ Indianapolis, IN 46225 United States
+
+ ●●●
+
+ Topcoder System Information: +
+ InterviewType: {{xai_template}}
+
+ + + + + + +
+
+
diff --git a/data/resource-placed-email-template.html b/data/resource-placed-email-template.html new file mode 100644 index 00000000..c92e6d6d --- /dev/null +++ b/data/resource-placed-email-template.html @@ -0,0 +1,258 @@ +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + + + + + + +
IMG +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ Get Excited
+
+ + + + + + + + + +
IMG + Your Topcoder Talent is Confirmed +
+
+ Pop the metaphorical champagne. Your Topcoder talent is officially confirmed! This person is super excited to work with you. Here are the details. +
+
+ + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + +
Team NameJob TitleResource Booking HandleResource Booking Start DateResource Booking End Date
{{teamName}}{{jobTitle}}{{userHandle}}{{startDate}}{{endDate}}
+ +
+ Thanks! +

+ The Topcoder Team +

+
+
+
+ + + + + + +
+
+ + + + + + +
+
+
+ + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+ + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ 201 S Capitol Ave #1100
+ Indianapolis, IN 46225 United States
+
+ ●●●
+
+ Topcoder System Information: +
+ InterviewType: {{xai_template}}
+
+ + + + + + +
+
+
diff --git a/data/upcoming-resource-booking-expiration-email-template.html b/data/upcoming-resource-booking-expiration-email-template.html new file mode 100644 index 00000000..a199bd5c --- /dev/null +++ b/data/upcoming-resource-booking-expiration-email-template.html @@ -0,0 +1,263 @@ +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + + + + + + +
IMG +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ Reminder
+
+ + + + + + + + + +
IMG + Work End Date Approaching +
+
+ Good things can’t last forever, and your freelancer’s work End Date is approaching. Want to continue working with them? Request an extension here by clicking on the Actions menu and selecting “Request an Extension”. +
+
+ To check the end date for any talent on your team, log in to your account and head to your Teams page. +
+
+ + + + + + +
+ + + + + + + + +
+ + + + + + + + {{#each teamResourceBookings}} + + + + + + {{/each}} +
Job titleResource Bookings HandleEnd Date
+ {{this.jobTitle}} + + {{this.handle}} + {{this.endDate}}
+ +
+ Thanks! +

+ The Topcoder Team +

+
+
+
+ + + + + + +
+
+ + + + + + +
+
+
+ + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+ + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ 201 S Capitol Ave #1100
+ Indianapolis, IN 46225 United States
+
+ ●●●
+
+ Topcoder System Information: +
+ InterviewType: {{xai_template}}
+
+ + + + + + +
+
+
diff --git a/scripts/demo-email-notifications/index.js b/scripts/demo-email-notifications/index.js index 7e5b19c0..3ffeed02 100644 --- a/scripts/demo-email-notifications/index.js +++ b/scripts/demo-email-notifications/index.js @@ -16,7 +16,18 @@ const localLogger = { info: message => logger.info({ component: 'render email content', context: 'test', message }) } -const template = handlebars.compile(fs.readFileSync('./data/notifications-email-template.html', 'utf8')) +const templateFileMap = { + [config.NOTIFICATION_CLIENT_VIEWED_PROFILE_SENDGRID_TEMPLATE_ID]: handlebars.compile(fs.readFileSync('./data/candidate-was-viewed-by-client-email-template.html', 'utf8')), + [config.NOTIFICATION_REVIEW_CANDIDATES_SENDGRID_TEMPLATE_ID]: handlebars.compile(fs.readFileSync('./data/candidates-are-available-for-review-email-template.html', 'utf8')), + [config.NOTIFICATION_CUSTOMER_INTERVIEW_COMING_UP_SENDGRID_TEMPLATE_ID]: handlebars.compile(fs.readFileSync('./data/customer-interview-coming-up-email-template.html', 'utf8')), + [config.NOTIFICATION_MEMBER_INTERVIEW_COMING_UP_SENDGRID_TEMPLATE_ID]: handlebars.compile(fs.readFileSync('./data/members-interview-coming-up-email-template.html', 'utf8')), + [config.NOTIFICATION_INTERVIEW_COMPLETE_SENDGRID_TEMPLATE_ID]: handlebars.compile(fs.readFileSync('./data/interview-completed-email-template.html', 'utf8')), + [config.NOTIFICATION_POST_INTERVIEW_ACTION_SENDGRID_TEMPLATE_ID]: handlebars.compile(fs.readFileSync('./data/post-interview-action-reminder-email-template.html', 'utf8')), + [config.NOTIFICATION_UPCOMING_RESOURCE_BOOKING_EXPIRATION_SENDGRID_TEMPLATE_ID]: handlebars.compile(fs.readFileSync('./data/upcoming-resource-booking-expiration-email-template.html', 'utf8')), + [config.NOTIFICATION_NEW_TEAM_CREATED_SENDGRID_TEMPLATE_ID]: handlebars.compile(fs.readFileSync('./data/new-team-created-email-template.html', 'utf8')), + [config.NOTIFICATION_NEW_JOB_ADDED_SENDGRID_TEMPLATE_ID]: handlebars.compile(fs.readFileSync('./data/new-job-added-to-existing-project-email-template.html', 'utf8')), + [config.NOTIFICATION_RESOURCE_BOOKING_PLACED_SENDGRID_TEMPLATE_ID]: handlebars.compile(fs.readFileSync('./data/resource-placed-email-template.html', 'utf8')) +} /** * Reset notification records @@ -71,7 +82,7 @@ async function initConsumer () { } if (message.payload.notifications) { _.forEach(_.filter(message.payload.notifications, ['serviceId', 'email']), (notification) => { - const email = template(notification.details.data) + const email = templateFileMap[notification.details.sendgridTemplateId](notification.details.data) fs.writeFileSync(`./out/${notification.details.data.subject}-${Date.now()}.html`, email) }) for (const notification of _.filter(message.payload.notifications, ['serviceId', 'slack'])) { From 5c121795259bcc325d6984af1346a12c2f4b1399 Mon Sep 17 00:00:00 2001 From: xxcxy Date: Wed, 1 Sep 2021 15:59:30 +0800 Subject: [PATCH 2/3] add two email template and update the file format --- config/default.js | 4 + config/email_template.config.js | 4 +- ...e-was-viewed-by-client-email-template.html | 6 +- ...e-available-for-review-email-template.html | 8 +- ...er-interview-coming-up-email-template.html | 13 +- data/interview-completed-email-template.html | 13 +- ...nterviews-overlapping-email-template.html} | 20 -- ...job-candidate-selected-email-template.html | 257 ++++++++++++++++++ ...rs-interview-coming-up-email-template.html | 6 +- ...ed-to-existing-project-email-template.html | 7 +- data/new-team-created-email-template.html | 7 +- ...erview-action-reminder-email-template.html | 7 +- data/resource-placed-email-template.html | 7 +- ...rce-booking-expiration-email-template.html | 13 +- scripts/demo-email-notifications/index.js | 2 + 15 files changed, 313 insertions(+), 61 deletions(-) rename data/{notifications-email-template.html => interviews-overlapping-email-template.html} (85%) create mode 100644 data/job-candidate-selected-email-template.html diff --git a/config/default.js b/config/default.js index 7ba05ecc..70e55990 100644 --- a/config/default.js +++ b/config/default.js @@ -273,6 +273,10 @@ module.exports = { NOTIFICATION_NEW_JOB_ADDED_SENDGRID_TEMPLATE_ID: process.env.NOTIFICATION_NEW_JOB_ADDED_SENDGRID_TEMPLATE_ID, // the email notification sendgrid template id of resource placed NOTIFICATION_RESOURCE_BOOKING_PLACED_SENDGRID_TEMPLATE_ID: process.env.NOTIFICATION_RESOURCE_BOOKING_PLACED_SENDGRID_TEMPLATE_ID, + // the email notification sendgrid template id of interviews overlapping + NOTIFICATION_INTERVIEWS_OVERLAPPING_SENDGRID_TEMPLATE_ID: process.env.NOTIFICATION_INTERVIEWS_OVERLAPPING_SENDGRID_TEMPLATE_ID, + // the email notification sendgrid template id of job candidate selected + NOTIFICATION_JOB_CANDIDATE_SELECTED_SENDGRID_TEMPLATE_ID: process.env.NOTIFICATION_JOB_CANDIDATE_SELECTED_SENDGRID_TEMPLATE_ID, // frequency of cron checking for available candidates for review CRON_CANDIDATE_REVIEW: process.env.CRON_CANDIDATE_REVIEW || '00 00 13 * * 0-6', // frequency of cron checking for coming up interviews diff --git a/config/email_template.config.js b/config/email_template.config.js index ebac365b..fc5d4118 100644 --- a/config/email_template.config.js +++ b/config/email_template.config.js @@ -179,14 +179,14 @@ module.exports = { body: '', recipients: config.NOTIFICATION_OPS_EMAILS, from: config.NOTIFICATION_SENDER_EMAIL, - sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID + sendgridTemplateId: config.NOTIFICATION_INTERVIEWS_OVERLAPPING_SENDGRID_TEMPLATE_ID }, 'taas.notification.job-candidate-selected': { subject: 'Topcoder - Job Candidate {{userHandle}} Selected for {{jobTitle}} in Team {{teamName}}', body: '', recipients: config.NOTIFICATION_OPS_EMAILS, from: config.NOTIFICATION_SENDER_EMAIL, - sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID + sendgridTemplateId: config.NOTIFICATION_JOB_CANDIDATE_SELECTED_SENDGRID_TEMPLATE_ID }, 'taas.notification.resource-booking-placed': { subject: 'Your Topcoder talent is confirmed! How to start working with them.', diff --git a/data/candidate-was-viewed-by-client-email-template.html b/data/candidate-was-viewed-by-client-email-template.html index 968415e0..0e714e21 100644 --- a/data/candidate-was-viewed-by-client-email-template.html +++ b/data/candidate-was-viewed-by-client-email-template.html @@ -73,9 +73,6 @@ Client Has Viewed Your Profile -
-
- Thanks for applying for a Topcoder Gig. This is an update to let you know that the client has viewed your profile. We will notify you about next steps. @@ -98,6 +95,9 @@ +
+ Thanks for applying for a Topcoder Gig. This is an update to let you know that the client has viewed your profile. We will notify you about next steps. +

To check the status of all your Gig Work applications, log in to your Topcoder account and head to My Gigs → Open Applications. diff --git a/data/candidates-are-available-for-review-email-template.html b/data/candidates-are-available-for-review-email-template.html index bf67f268..32e5f89f 100644 --- a/data/candidates-are-available-for-review-email-template.html +++ b/data/candidates-are-available-for-review-email-template.html @@ -73,9 +73,7 @@ Here are Your Candidates Awaiting Review -
-
- You’ve matched with talent! Use the link below to review your candidates. You can schedule an interview if you want to move forward, or decline if they’re not a match. + @@ -98,6 +96,10 @@ +
+ You’ve matched with talent! Use the link below to review your candidates. You can schedule an interview if you want to move forward, or decline if they’re not a match. +
+
diff --git a/data/customer-interview-coming-up-email-template.html b/data/customer-interview-coming-up-email-template.html index 9eaff621..f211b799 100644 --- a/data/customer-interview-coming-up-email-template.html +++ b/data/customer-interview-coming-up-email-template.html @@ -73,12 +73,6 @@ @@ -101,6 +95,13 @@
Job title Reminder: You Have an Upcoming Interview -
-
- Ohhh the butterflies before a first date. Just kidding, this is totally professional. But meeting someone who could potentially make your life a lot easier is very exciting. -
-
- 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.
+
+ Ohhh the butterflies before a first date. Just kidding, this is totally professional. But meeting someone who could potentially make your life a lot easier is very exciting. +
+
+ 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. +
+
diff --git a/data/interview-completed-email-template.html b/data/interview-completed-email-template.html index fb352f0f..156ecdca 100644 --- a/data/interview-completed-email-template.html +++ b/data/interview-completed-email-template.html @@ -73,12 +73,6 @@ @@ -101,6 +95,13 @@
Job title Interview Complete, What To Do Next -
-
- Thanks for taking the time to interview your candidate. We hope it went well and that they are a perfect fit. Now it’s time to take action: -
-
- Use the link below to Accept, Decline, or schedule another interview. Don’t wait—Topcoder talent is in high-demand:
+
+ Thanks for taking the time to interview your candidate. We hope it went well and that they are a perfect fit. Now it’s time to take action: +
+
+ Use the link below to Accept, Decline, or schedule another interview. Don’t wait—Topcoder talent is in high-demand: +
+
diff --git a/data/notifications-email-template.html b/data/interviews-overlapping-email-template.html similarity index 85% rename from data/notifications-email-template.html rename to data/interviews-overlapping-email-template.html index a8befab4..7e739e89 100644 --- a/data/notifications-email-template.html +++ b/data/interviews-overlapping-email-template.html @@ -96,7 +96,6 @@ @@ -98,6 +95,9 @@ @@ -98,6 +95,10 @@
Job title - {{#if notificationType.overlappingInterview}} @@ -115,25 +114,6 @@ {{/each}}
Team Name
- {{/if}} - {{#if notificationType.candidateSelected}} - - - - - - - - - - - - - - - -
Team NameJob TitleJob Start DateJob DurationJob Candidate
{{teamName}}{{jobTitle}}{{jobStartDate}}{{jobDuration}}{{userHandle}}
- {{/if}}
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 our Gig Work operations team. diff --git a/data/job-candidate-selected-email-template.html b/data/job-candidate-selected-email-template.html new file mode 100644 index 00000000..ac7c2b33 --- /dev/null +++ b/data/job-candidate-selected-email-template.html @@ -0,0 +1,257 @@ +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + + + + + + +
IMG +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ Topcoder Gig Work
+
+ + + + + + + + + +
IMG + {{description}} +
+
+ + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + +
Team NameJob TitleJob Start DateJob DurationJob Candidate
{{teamName}}{{jobTitle}}{{jobStartDate}}{{jobDuration}}{{userHandle}}
+ +
+ 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 our Gig Work operations team. + +

Thanks!
+ The Topcoder Team +

+
+
+
+ + + + + + +
+
+ + + + + + +
+
+
+ + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+ + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ 201 S Capitol Ave #1100
+ Indianapolis, IN 46225 United States
+
+ ●●●
+
+ Topcoder System Information: +
+ InterviewType: {{xai_template}}
+
+ + + + + + +
+
+
diff --git a/data/members-interview-coming-up-email-template.html b/data/members-interview-coming-up-email-template.html index 48462061..f623b166 100644 --- a/data/members-interview-coming-up-email-template.html +++ b/data/members-interview-coming-up-email-template.html @@ -73,9 +73,6 @@
You Have an Upcoming Interview -
-
- You have an interview coming up for a Topcoder gig! See the job and get the meeting link here.
+
+ You have an interview coming up for a Topcoder gig! See the job and get the meeting link here. +

If you’re signed in to your Topcoder account, you can also find this information on the My Gigs Applications page. diff --git a/data/new-job-added-to-existing-project-email-template.html b/data/new-job-added-to-existing-project-email-template.html index 4507eb84..9b51a2cd 100644 --- a/data/new-job-added-to-existing-project-email-template.html +++ b/data/new-job-added-to-existing-project-email-template.html @@ -73,9 +73,6 @@
New Job Added to Your Team -
-
- We’ve received your request for a new role on your team. We’ll notify you when you have a new candidate to review. You can add more roles to your team any time.
+
+ We’ve received your request for a new role on your team. We’ll notify you when you have a new candidate to review. You can add more roles to your team any time. +
+
diff --git a/data/new-team-created-email-template.html b/data/new-team-created-email-template.html index a872592a..6c88cb7a 100644 --- a/data/new-team-created-email-template.html +++ b/data/new-team-created-email-template.html @@ -73,9 +73,6 @@ @@ -98,6 +95,10 @@ + diff --git a/data/upcoming-resource-booking-expiration-email-template.html b/data/upcoming-resource-booking-expiration-email-template.html index 30eeb86e..46b3ae37 100644 --- a/data/upcoming-resource-booking-expiration-email-template.html +++ b/data/upcoming-resource-booking-expiration-email-template.html @@ -96,13 +96,13 @@ + diff --git a/scripts/demo-email-notifications/README.md b/scripts/demo-email-notifications/README.md index e55e275d..3284b1fa 100644 --- a/scripts/demo-email-notifications/README.md +++ b/scripts/demo-email-notifications/README.md @@ -10,13 +10,25 @@ This script does 2 things: 1. Config scheduler to run more often so we don't have to wait to long for triggering notification, like every minute: ```sh - CRON_CANDIDATE_REVIEW=0 */1 * * * * +2CRON_CANDIDATE_REVIEW=0 */1 * * * * CRON_INTERVIEW_COMING_UP=0 */1 * * * * CRON_INTERVIEW_COMPLETED=0 */1 * * * * CRON_POST_INTERVIEW=0 */1 * * * * CRON_UPCOMING_RESOURCE_BOOKING=0 */1 * * * * INTERVIEW_COMING_UP_MATCH_WINDOW=PT1M INTERVIEW_COMPLETED_MATCH_WINDOW=PT1M + NOTIFICATION_CLIENT_VIEWED_PROFILE_SENDGRID_TEMPLATE_ID=1 + NOTIFICATION_REVIEW_CANDIDATES_SENDGRID_TEMPLATE_ID=2 + NOTIFICATION_CUSTOMER_INTERVIEW_COMING_UP_SENDGRID_TEMPLATE_ID=3 + NOTIFICATION_MEMBER_INTERVIEW_COMING_UP_SENDGRID_TEMPLATE_ID=4 + NOTIFICATION_INTERVIEW_COMPLETE_SENDGRID_TEMPLATE_ID=5 + NOTIFICATION_POST_INTERVIEW_ACTION_SENDGRID_TEMPLATE_ID=6 + NOTIFICATION_UPCOMING_RESOURCE_BOOKING_EXPIRATION_SENDGRID_TEMPLATE_ID=7 + NOTIFICATION_NEW_TEAM_CREATED_SENDGRID_TEMPLATE_ID=8 + NOTIFICATION_NEW_JOB_ADDED_SENDGRID_TEMPLATE_ID=9 + NOTIFICATION_RESOURCE_BOOKING_PLACED_SENDGRID_TEMPLATE_ID=10 + NOTIFICATION_INTERVIEWS_OVERLAPPING_SENDGRID_TEMPLATE_ID=11 + NOTIFICATION_JOB_CANDIDATE_SELECTED_SENDGRID_TEMPLATE_ID=12 ``` 2. Config `SLACK_WEBHOOK_URL` env, if you want to send slack notifications diff --git a/src/eventHandlers/InterviewEventHandler.js b/src/eventHandlers/InterviewEventHandler.js index 034c1a8f..22b0d44e 100644 --- a/src/eventHandlers/InterviewEventHandler.js +++ b/src/eventHandlers/InterviewEventHandler.js @@ -108,11 +108,7 @@ async function checkOverlapping (payload) { recipients: (template.recipients || []).map(email => ({ email })), data: { subject: template.subject, - interviews, - notificationType: { - overlappingInterview: true - }, - description: 'Overlapping Job Candidate Interviews' + interviews }, sendgridTemplateId: template.sendgridTemplateId, version: 'v3' diff --git a/src/eventHandlers/JobCandidateEventHandler.js b/src/eventHandlers/JobCandidateEventHandler.js index 2e389879..6ea679d3 100644 --- a/src/eventHandlers/JobCandidateEventHandler.js +++ b/src/eventHandlers/JobCandidateEventHandler.js @@ -165,11 +165,7 @@ async function sendJobCandidateSelectedNotification (payload) { jobStartDate: helper.formatDateEDT(job.startDate), userHandle: user.handle, jobUrl, - rcrmJobUrl, - notificationType: { - candidateSelected: true - }, - description: 'Job Candidate Selected' + rcrmJobUrl } data.subject = helper.substituteStringByObject(data.subject, data) const emailData = { diff --git a/src/eventHandlers/JobEventHandler.js b/src/eventHandlers/JobEventHandler.js index f736502c..c92c1920 100644 --- a/src/eventHandlers/JobEventHandler.js +++ b/src/eventHandlers/JobEventHandler.js @@ -91,11 +91,7 @@ async function sendNotifications (payload) { jobTitle: payload.value.title, jobURL: `${config.TAAS_APP_URL}/${project.id}/positions/${payload.value.id}`, jobDuration: payload.value.duration, - jobStartDate: helper.formatDateEDT(payload.value.startDate), - notificationType: { - newJobCreated: true - }, - description: 'New Job Created' + jobStartDate: helper.formatDateEDT(payload.value.startDate) } data.subject = helper.substituteStringByObject(data.subject, data) diff --git a/src/eventHandlers/ResourceBookingEventHandler.js b/src/eventHandlers/ResourceBookingEventHandler.js index de4f125e..7b20427a 100644 --- a/src/eventHandlers/ResourceBookingEventHandler.js +++ b/src/eventHandlers/ResourceBookingEventHandler.js @@ -97,11 +97,7 @@ async function sendPlacedNotifications (payload) { jobUrl, userHandle: user.handle, startDate: resourceBooking.startDate, - endDate: resourceBooking.endDate, - notificationType: { - resourceBookingPlaced: true - }, - description: 'Resource Booking is Placed' + endDate: resourceBooking.endDate } data.subject = helper.substituteStringByObject(data.subject, data) const emailData = { diff --git a/src/eventHandlers/TeamEventHandler.js b/src/eventHandlers/TeamEventHandler.js index 985ffc61..3fd0a775 100644 --- a/src/eventHandlers/TeamEventHandler.js +++ b/src/eventHandlers/TeamEventHandler.js @@ -24,11 +24,7 @@ async function sendNotificationEmail (payload) { duration: j.duration, startDate: helper.formatDateEDT(j.startDate), jobUrl: `${config.TAAS_APP_URL}/${payload.project.id}/positions/${j.id}` - })), - notificationType: { - newTeamCreated: true - }, - description: 'New Team Created' + })) } data.subject = helper.substituteStringByObject(data.subject, data) diff --git a/src/services/JobCandidateService.js b/src/services/JobCandidateService.js index 29f28d88..724fc368 100644 --- a/src/services/JobCandidateService.js +++ b/src/services/JobCandidateService.js @@ -381,10 +381,7 @@ async function downloadJobCandidateResume (currentUser, id) { data: { jobCandidateUserHandle: handle, jobName: job.title, - description: 'Client Viewed Resume', - notificationType: { - jobCandidateResumeViewed: true - } + applicationUrl: `${config.TAAS_APP_EARN_URL}?status=Active%20Gigs` } }) diff --git a/src/services/NotificationsSchedulerService.js b/src/services/NotificationsSchedulerService.js index 133553d1..4bdc92dc 100644 --- a/src/services/NotificationsSchedulerService.js +++ b/src/services/NotificationsSchedulerService.js @@ -90,6 +90,7 @@ async function getDataForInterview (interview, jobCandidate, job) { const guestName = _.isEmpty(interview.guestNames) ? '' : interview.guestNames[0] const startTime = interview.startTimestamp ? helper.formatDateTimeEDT(interview.startTimestamp) : '' const jobUrl = `${config.TAAS_APP_URL}/${job.projectId}/positions/${job.id}` + const applicationUrl = `${config.TAAS_APP_EARN_URL}?status=Active%20Gigs` return { jobTitle: job.title, @@ -101,6 +102,7 @@ async function getDataForInterview (interview, jobCandidate, job) { startTime: startTime, duration: interview.duration, interviewLink, + applicationUrl, jobUrl } } @@ -174,11 +176,7 @@ async function sendCandidatesAvailableNotifications () { recipients: projectTeamRecipients, data: { teamName: project.name, - teamJobs, - notificationType: { - candidatesAvailableForReview: true - }, - description: 'Candidates are available for review' + teamJobs } }) @@ -242,13 +240,7 @@ async function sendInterviewComingUpNotifications () { sendNotification({}, { template: 'taas.notification.interview-coming-up-host', recipients: [{ email: interview.hostEmail }], - data: { - ...data, - notificationType: { - interviewComingUpForHost: true - }, - description: 'Interview Coming Up' - } + data }) sentHostCount++ @@ -261,13 +253,7 @@ async function sendInterviewComingUpNotifications () { sendNotification({}, { template: 'taas.notification.interview-coming-up-guest', recipients: interview.guestEmails.map((email) => ({ email })), - data: { - ...data, - notificationType: { - interviewComingUpForGuest: true - }, - description: 'Interview Coming Up' - } + data }) sentGuestCount++ @@ -327,13 +313,7 @@ async function sendInterviewCompletedNotifications () { sendNotification({}, { template: 'taas.notification.interview-awaits-resolution', recipients: [{ email: interview.hostEmail }], - data: { - ...data, - notificationType: { - interviewCompleted: true - }, - description: 'Interview Completed' - } + data }) sentCount++ @@ -425,11 +405,7 @@ async function sendPostInterviewActionNotifications () { data: { teamName: project.name, numCandidates, - teamInterviews, - notificationType: { - postInterviewCandidateAction: true - }, - description: 'Post Interview Candidate Action Reminder' + teamInterviews } }, webNotifications) @@ -528,11 +504,7 @@ async function sendResourceBookingExpirationNotifications () { teamName: project.name, numResourceBookings, teamResourceBookings, - notificationType: { - upcomingResourceBookingExpiration: true - }, - teamUrl, - description: 'Upcoming Resource Booking Expiration' + teamUrl } }, [webData])
Team Name Talent Request Confirmed -
-
- Congratulations! You’ve successfully submitted your talent request to Topcoder. We’ll notify you when you have a new candidate to review. You can add more roles to your team at any time.
+
+ Congratulations! You’ve successfully submitted your talent request to Topcoder. We’ll notify you when you have a new candidate to review. You can add more roles to your team at any time. +
+
diff --git a/data/post-interview-action-reminder-email-template.html b/data/post-interview-action-reminder-email-template.html index b81b261d..5770bc35 100644 --- a/data/post-interview-action-reminder-email-template.html +++ b/data/post-interview-action-reminder-email-template.html @@ -73,9 +73,6 @@ @@ -98,6 +95,10 @@ + diff --git a/data/interviews-overlapping-email-template.html b/data/interviews-overlapping-email-template.html index 7e739e89..14d9ec44 100644 --- a/data/interviews-overlapping-email-template.html +++ b/data/interviews-overlapping-email-template.html @@ -96,7 +96,7 @@ + diff --git a/data/resource-placed-email-template.html b/data/resource-placed-email-template.html index d759f8eb..4137f41b 100644 --- a/data/resource-placed-email-template.html +++ b/data/resource-placed-email-template.html @@ -99,7 +99,7 @@ Pop the metaphorical champagne. Your Topcoder talent is officially confirmed! This person is super excited to work with you. Here are the details.

-
Job Title Take Action on This Candidate -
-
- Use the link below to Accept, Decline, or schedule another interview with your candidate. This person might have an offer on another gig, and is awaiting your response to make a decision. Please do this now:
+
+ Use the link below to Accept, Decline, or schedule another interview with your candidate. This person might have an offer on another gig, and is awaiting your response to make a decision. Please do this now: +
+
diff --git a/data/resource-placed-email-template.html b/data/resource-placed-email-template.html index c92e6d6d..d759f8eb 100644 --- a/data/resource-placed-email-template.html +++ b/data/resource-placed-email-template.html @@ -73,9 +73,6 @@ @@ -98,6 +95,10 @@ + diff --git a/data/interview-completed-email-template.html b/data/interview-completed-email-template.html index 156ecdca..5b4e0b97 100644 --- a/data/interview-completed-email-template.html +++ b/data/interview-completed-email-template.html @@ -102,7 +102,7 @@ Use the link below to Accept, Decline, or schedule another interview. Don’t wait—Topcoder talent is in high-demand:

-
Job title Your Topcoder Talent is Confirmed -
-
- Pop the metaphorical champagne. Your Topcoder talent is officially confirmed! This person is super excited to work with you. Here are the details.
+
+ Pop the metaphorical champagne. Your Topcoder talent is officially confirmed! This person is super excited to work with you. Here are the details. +
+
diff --git a/data/upcoming-resource-booking-expiration-email-template.html b/data/upcoming-resource-booking-expiration-email-template.html index a199bd5c..30eeb86e 100644 --- a/data/upcoming-resource-booking-expiration-email-template.html +++ b/data/upcoming-resource-booking-expiration-email-template.html @@ -73,12 +73,6 @@ @@ -101,6 +95,13 @@ + diff --git a/data/customer-interview-coming-up-email-template.html b/data/customer-interview-coming-up-email-template.html index f211b799..440462c1 100644 --- a/data/customer-interview-coming-up-email-template.html +++ b/data/customer-interview-coming-up-email-template.html @@ -52,7 +52,7 @@ + Interview Coming Up
Team Name Work End Date Approaching -
-
- Good things can’t last forever, and your freelancer’s work End Date is approaching. Want to continue working with them? Request an extension here by clicking on the Actions menu and selecting “Request an Extension”. -
-
- To check the end date for any talent on your team, log in to your account and head to your Teams page.
+
+ Good things can’t last forever, and your freelancer’s work End Date is approaching. Want to continue working with them? Request an extension here by clicking on the Actions menu and selecting “Request an Extension”. +
+
+ To check the end date for any talent on your team, log in to your account and head to your Teams page. +
+
diff --git a/scripts/demo-email-notifications/index.js b/scripts/demo-email-notifications/index.js index 3ffeed02..6c5021e6 100644 --- a/scripts/demo-email-notifications/index.js +++ b/scripts/demo-email-notifications/index.js @@ -26,6 +26,8 @@ const templateFileMap = { [config.NOTIFICATION_UPCOMING_RESOURCE_BOOKING_EXPIRATION_SENDGRID_TEMPLATE_ID]: handlebars.compile(fs.readFileSync('./data/upcoming-resource-booking-expiration-email-template.html', 'utf8')), [config.NOTIFICATION_NEW_TEAM_CREATED_SENDGRID_TEMPLATE_ID]: handlebars.compile(fs.readFileSync('./data/new-team-created-email-template.html', 'utf8')), [config.NOTIFICATION_NEW_JOB_ADDED_SENDGRID_TEMPLATE_ID]: handlebars.compile(fs.readFileSync('./data/new-job-added-to-existing-project-email-template.html', 'utf8')), + [config.NOTIFICATION_INTERVIEWS_OVERLAPPING_SENDGRID_TEMPLATE_ID]: handlebars.compile(fs.readFileSync('./data/interviews-overlapping-email-template.html', 'utf8')), + [config.NOTIFICATION_JOB_CANDIDATE_SELECTED_SENDGRID_TEMPLATE_ID]: handlebars.compile(fs.readFileSync('./data/job-candidate-selected-email-template.html', 'utf8')), [config.NOTIFICATION_RESOURCE_BOOKING_PLACED_SENDGRID_TEMPLATE_ID]: handlebars.compile(fs.readFileSync('./data/resource-placed-email-template.html', 'utf8')) } From 845cfdc67e2b80c8f153b2a2b691d0131e5e21ac Mon Sep 17 00:00:00 2001 From: xxcxy Date: Wed, 1 Sep 2021 19:49:18 +0800 Subject: [PATCH 3/3] fix email format --- config/default.js | 2 + ...e-was-viewed-by-client-email-template.html | 9 ++-- ...e-available-for-review-email-template.html | 10 +++-- ...er-interview-coming-up-email-template.html | 11 +++-- data/interview-completed-email-template.html | 8 +++- ...interviews-overlapping-email-template.html | 5 ++- ...job-candidate-selected-email-template.html | 5 ++- ...rs-interview-coming-up-email-template.html | 9 ++-- ...ed-to-existing-project-email-template.html | 9 ++-- data/new-team-created-email-template.html | 5 ++- ...erview-action-reminder-email-template.html | 10 ++++- data/resource-placed-email-template.html | 9 ++-- ...rce-booking-expiration-email-template.html | 11 +++-- scripts/demo-email-notifications/README.md | 14 +++++- src/eventHandlers/InterviewEventHandler.js | 6 +-- src/eventHandlers/JobCandidateEventHandler.js | 6 +-- src/eventHandlers/JobEventHandler.js | 6 +-- .../ResourceBookingEventHandler.js | 6 +-- src/eventHandlers/TeamEventHandler.js | 6 +-- src/services/JobCandidateService.js | 5 +-- src/services/NotificationsSchedulerService.js | 44 ++++--------------- 21 files changed, 101 insertions(+), 95 deletions(-) diff --git a/config/default.js b/config/default.js index 70e55990..53f2d5f0 100644 --- a/config/default.js +++ b/config/default.js @@ -179,6 +179,8 @@ module.exports = { INTERVIEW_INVITATION_SENDER_EMAIL: process.env.INTERVIEW_INVITATION_SENDER_EMAIL || 'talent@topcoder.com', // the URL where TaaS App is hosted TAAS_APP_URL: process.env.TAAS_APP_URL || 'https://platform.topcoder-dev.com/taas/myteams', + // the URL where TaaS App Earn is hosted + TAAS_APP_EARN_URL: process.env.TAAS_APP_EARN_URL || 'https://platform.topcoder-dev.com/earn/my-gigs', // environment variables for Payment Service ROLE_ID_SUBMITTER: process.env.ROLE_ID_SUBMITTER || '732339e7-8e30-49d7-9198-cccf9451e221', TYPE_ID_TASK: process.env.TYPE_ID_TASK || 'ecd58c69-238f-43a4-a4bb-d172719b9f31', diff --git a/data/candidate-was-viewed-by-client-email-template.html b/data/candidate-was-viewed-by-client-email-template.html index 0e714e21..e99d2fb7 100644 --- a/data/candidate-was-viewed-by-client-email-template.html +++ b/data/candidate-was-viewed-by-client-email-template.html @@ -100,15 +100,18 @@

- To check the status of all your Gig Work applications, log in to your Topcoder account and head to My Gigs → Open Applications. + To check the status of all your Gig Work applications, log in to your Topcoder account and head to My Gigs → Open Applications.

- Thanks! -

+ +

Thanks!
The Topcoder Team

+
diff --git a/data/candidates-are-available-for-review-email-template.html b/data/candidates-are-available-for-review-email-template.html index 32e5f89f..64fd2478 100644 --- a/data/candidates-are-available-for-review-email-template.html +++ b/data/candidates-are-available-for-review-email-template.html @@ -100,7 +100,7 @@ You’ve matched with talent! Use the link below to review your candidates. You can schedule an interview if you want to move forward, or decline if they’re not a match.

-
Job title +
+
@@ -128,11 +128,15 @@
Job title No of resource bookings

- Thanks! -

+ Review Your Candidates + +

Thanks!
The Topcoder Team

+
- interview Coming Up
@@ -102,7 +102,7 @@ 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.

- +
@@ -129,11 +129,14 @@
Job title Candidate Handle

- Can’t wait to hear how it goes, -

+ Candidate resume and profile +

Can’t wait to hear how it goes,
The Topcoder Team

+
+
@@ -128,12 +128,18 @@
Job title Candidate Handle
+
+ Take action on your candidates +

Any issues with this interview? Please contact us here.

Thanks!
The Topcoder Team

+
- +
@@ -122,6 +122,9 @@ The Topcoder Team

+ diff --git a/data/job-candidate-selected-email-template.html b/data/job-candidate-selected-email-template.html index ac7c2b33..86dc733c 100644 --- a/data/job-candidate-selected-email-template.html +++ b/data/job-candidate-selected-email-template.html @@ -96,7 +96,7 @@ + diff --git a/data/new-team-created-email-template.html b/data/new-team-created-email-template.html index 6c88cb7a..8ecfd7b1 100644 --- a/data/new-team-created-email-template.html +++ b/data/new-team-created-email-template.html @@ -99,7 +99,7 @@ Congratulations! You’ve successfully submitted your talent request to Topcoder. We’ll notify you when you have a new candidate to review. You can add more roles to your team at any time.

-
Team Name Job Title +
- +
@@ -120,6 +120,9 @@ The Topcoder Team

+ diff --git a/data/members-interview-coming-up-email-template.html b/data/members-interview-coming-up-email-template.html index f623b166..d24ab4f5 100644 --- a/data/members-interview-coming-up-email-template.html +++ b/data/members-interview-coming-up-email-template.html @@ -99,14 +99,17 @@ You have an interview coming up for a Topcoder gig! See the job and get the meeting link here.

- If you’re signed in to your Topcoder account, you can also find this information on the My Gigs Applications page. + If you’re signed in to your Topcoder account, you can also find this information on the My Gigs Applications page.
- Can’t wait to hear how it goes, -

+ +

Good luck at the interview!
The Topcoder Team

+ diff --git a/data/new-job-added-to-existing-project-email-template.html b/data/new-job-added-to-existing-project-email-template.html index 9b51a2cd..d72610f2 100644 --- a/data/new-job-added-to-existing-project-email-template.html +++ b/data/new-job-added-to-existing-project-email-template.html @@ -99,7 +99,7 @@ We’ve received your request for a new role on your team. We’ll notify you when you have a new candidate to review. You can add more roles to your team any time.

-
Team Name Job Title +
+
+
@@ -115,11 +115,14 @@
Team Name Job Title

- Thanks! -

+ +

Thanks!
The Topcoder Team

+
+
@@ -120,6 +120,9 @@ The Topcoder Team

+ diff --git a/data/post-interview-action-reminder-email-template.html b/data/post-interview-action-reminder-email-template.html index 5770bc35..7165f5f4 100644 --- a/data/post-interview-action-reminder-email-template.html +++ b/data/post-interview-action-reminder-email-template.html @@ -52,7 +52,7 @@ + Reminder: Ghosting Is Not Cool
Job Title Job Start Date +
- Ghosting Is Not Cool
@@ -99,7 +99,7 @@ Use the link below to Accept, Decline, or schedule another interview with your candidate. This person might have an offer on another gig, and is awaiting your response to make a decision. Please do this now:

- +
@@ -127,12 +127,18 @@ {{/each}}
Job title Handle
+
+ Take action on your candidates +

Any issues? Please contact us here.

Thanks!
The Topcoder Team

+
+
@@ -117,11 +117,14 @@
Team Name Job Title

- Thanks! -

+ +

Thanks!
The Topcoder Team

+

- Good things can’t last forever, and your freelancer’s work End Date is approaching. Want to continue working with them? Request an extension here by clicking on the Actions menu and selecting “Request an Extension”. + Good things can’t last forever, and your freelancer’s work End Date is approaching. Want to continue working with them? Request an extension here by clicking on the Actions menu and selecting “Request an Extension”.

To check the end date for any talent on your team, log in to your account and head to your Teams page.

- +
@@ -122,11 +122,14 @@
Job title Resource Bookings Handle

- Thanks! -

+ +

Thanks!
The Topcoder Team

+