Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ workflows:
context : org-global
filters:
branches:
only: ['develop', 'migration-setup']
only: ['develop', 'migration-setup', 'pm-1356']
- deployProd:
context : org-global
filters:
Expand Down
1 change: 1 addition & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ export const CONNECT_NOTIFICATION_EVENT = {
export const TEMPLATE_IDS = {
APPLY_COPILOT: 'd-d7c1f48628654798a05c8e09e52db14f',
CREATE_REQUEST: 'd-3efdc91da580479d810c7acd50a4c17f',
PROJECT_MEMBER_INVITED: 'd-b47a25b103604bc28fc0ce77e77fb681',
}
export const REGEX = {
URL: /^(http(s?):\/\/)?(www\.)?[a-zA-Z0-9\.\-\_]+(\.[a-zA-Z]{2,15})+(\:[0-9]{2,5})?(\/[a-zA-Z0-9\_\-\s\.\/\?\%\#\&\=;]*)?$/, // eslint-disable-line
Expand Down
9 changes: 3 additions & 6 deletions src/routes/projectMemberInvites/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
RESOURCES,
MAX_PARALLEL_REQUEST_QTY,
CONNECT_NOTIFICATION_EVENT,
TEMPLATE_IDS,
} from '../../constants';
import { createEvent } from '../../services/busApi';
import { PERMISSION, PROJECT_TO_TOPCODER_ROLES_MATRIX } from '../../permissions/constants';
Expand Down Expand Up @@ -201,7 +202,7 @@ const buildCreateInvitePromises = (req, inviteEmails, inviteUserIds, invites, da
const sendInviteEmail = (req, projectId, invite) => {
req.log.debug(`Sending invite email: ${JSON.stringify(req.body)}, ${projectId}, ${JSON.stringify(invite)}`);
req.log.debug(req.authUser);
const emailEventType = CONNECT_NOTIFICATION_EVENT.PROJECT_MEMBER_EMAIL_INVITE_CREATED;
const emailEventType = CONNECT_NOTIFICATION_EVENT.EXTERNAL_ACTION_EMAIL;
const promises = [
models.Project.findOne({
where: { id: projectId },
Expand Down Expand Up @@ -237,13 +238,9 @@ const sendInviteEmail = (req, projectId, invite) => {
],
}],
},
sendgrid_template_id: TEMPLATE_IDS.PROJECT_MEMBER_INVITED,
recipients: [invite.email],
version: 'v3',
from: {
name: config.get('EMAIL_INVITE_FROM_NAME'),
email: config.get('EMAIL_INVITE_FROM_EMAIL'),
},
categories: [`${process.env.NODE_ENV}:${emailEventType}`.toLowerCase()],
}, req.log);
}).catch((error) => {
req.log.error(error);
Expand Down