Skip to content

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

Merged
merged 3 commits into from
Jul 23, 2025

Conversation

hentrymartin
Copy link
Collaborator

What's in this PR?

  • Add opportunity title and type in apply copilot email

Ticket link - https://topcoder.atlassian.net/browse/PM-1497

@@ -41,6 +41,12 @@ module.exports = [
where: {
id: copilotOpportunityId,
},
include: [

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),

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,

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.

@hentrymartin hentrymartin requested a review from kkartunov July 23, 2025 15:50
@hentrymartin hentrymartin merged commit 8218b87 into develop Jul 23, 2025
1 of 2 checks passed
@hentrymartin hentrymartin deleted the pm-1497 branch July 23, 2025 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants