-
Notifications
You must be signed in to change notification settings - Fork 56
fix(PM-1497): Add opportunity title and type in apply copilot email #834
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -41,6 +41,12 @@ module.exports = [ | |||
where: { | |||
id: copilotOpportunityId, | |||
}, | |||
include: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider specifying the attributes you need from the copilotRequest
model to optimize the query and reduce unnecessary data retrieval.
listOfSubjects.forEach((subject) => { | ||
createEvent(emailEventType, { | ||
data: { | ||
user_name: subject.handle, | ||
opportunity_details_url: `${copilotPortalUrl}/opportunity/${opportunity.id}#applications`, | ||
work_manager_url: config.get('workManagerUrl'), | ||
opportunity_type: getCopilotTypeLabel(requestData.projectType), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that getCopilotTypeLabel
function handles all possible values of requestData.projectType
to avoid potential errors or unexpected behavior.
listOfSubjects.forEach((subject) => { | ||
createEvent(emailEventType, { | ||
data: { | ||
user_name: subject.handle, | ||
opportunity_details_url: `${copilotPortalUrl}/opportunity/${opportunity.id}#applications`, | ||
work_manager_url: config.get('workManagerUrl'), | ||
opportunity_type: getCopilotTypeLabel(requestData.projectType), | ||
opportunity_title: requestData.opportunityTitle, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding validation to ensure requestData.opportunityTitle
is not null or undefined before using it, to prevent potential issues in the email content.
What's in this PR?
Ticket link - https://topcoder.atlassian.net/browse/PM-1497