Skip to content

Commit

Permalink
Add message id to failure notification (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
zekehuntergreen authored Apr 4, 2024
1 parent 7e0550d commit a13de37
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/output-handler/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ const successMessageBody = (
`;
};

const failureMessageBody = (originalFilename: string): string => {
const failureMessageBody = (originalFilename: string, id: string): string => {
return `
<h1>Transcription for ${originalFilename} has failed.</h1>
<p>Please make sure that the file is a valid audio or video file.</p>
<p>Contact the digital investigations team for support.</p>
<p>Transcription ID: ${id}</p>
`;
};

Expand Down Expand Up @@ -106,7 +107,10 @@ const handleTranscriptionFailure = async (
config.app.emailNotificationFromAddress,
transcriptionOutput.userEmail,
`Transcription failed for ${transcriptionOutput.originalFilename}`,
failureMessageBody(transcriptionOutput.originalFilename),
failureMessageBody(
transcriptionOutput.originalFilename,
transcriptionOutput.id,
),
);

logger.info('Output handler successfully sent failure email notification', {
Expand Down

0 comments on commit a13de37

Please sign in to comment.