Skip to content
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

Add message id to failure notification #77

Merged
merged 1 commit into from
Apr 4, 2024
Merged
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
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
Loading