diff --git a/api/src/middlewares/services/SubmitService/SubmitService.ts b/api/src/middlewares/services/SubmitService/SubmitService.ts index a113c3c6..8d172083 100644 --- a/api/src/middlewares/services/SubmitService/SubmitService.ts +++ b/api/src/middlewares/services/SubmitService/SubmitService.ts @@ -61,8 +61,12 @@ export class SubmitService { type, metadata, }); - const caseProcessJob = await caseService.sendToProcessQueue(processQueueData); - this.logger.info({ reference, caseProcessJob }, `SES_PROCESS job queued successfully for ${reference}`); + + // only email case team when there is no external reference (i.e. from Orbit) indicating a submission failure there + if (!metadata?.externalReference) { + const caseProcessJob = await caseService.sendToProcessQueue(processQueueData); + this.logger.info({reference, caseProcessJob}, `SES_PROCESS job queued successfully for ${reference}`); + } const userProcessJob = await this.userService.sendToProcessQueue(answers, { reference, payment: metadata.pay, type, postal: metadata.postal });