-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into NDT-471-Add-success-toast-and-feedback-for-A…
…ssessment-email-notification
- Loading branch information
Showing
26 changed files
with
568 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
app/backend/lib/emails/templates/notifyFailedReadOfTemplateData.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import getConfig from 'next/config'; | ||
import { | ||
EmailTemplate, | ||
EmailTemplateProvider, | ||
} from '../handleEmailNotification'; | ||
|
||
interface EmailTemplateParams { | ||
templateNumber: string; | ||
uuid: string; | ||
organizationName: string | undefined; | ||
projectTitle: string | undefined; | ||
uploadedAt: string | undefined; | ||
} | ||
|
||
const notifyFailedReadOfTemplateData: EmailTemplateProvider = ( | ||
applicationId: string, | ||
url: string, | ||
initiator, | ||
params: EmailTemplateParams | ||
): EmailTemplate => { | ||
const namespace = getConfig()?.publicRuntimeConfig?.OPENSHIFT_APP_NAMESPACE; | ||
let env = 'Dev'; | ||
if (namespace?.endsWith('-prod')) { | ||
env = 'Prod'; | ||
} else if (namespace?.endsWith('-test')) { | ||
env = 'Test'; | ||
} | ||
|
||
return { | ||
emailTo: [111, 112, 113, 114, 115], | ||
emailCC: [], | ||
tag: 'failed-read-of-template-data', | ||
subject: `Template ${params.templateNumber} - Failed Response`, | ||
body: ` | ||
<p> | ||
The following template upload by an applicant had a failed response at ${params.uploadedAt}: | ||
</p> | ||
<ul> | ||
<li>Environment: ${env}</li> | ||
<li>File UUID: ${params.uuid}</li> | ||
<li>Template Number: ${params.templateNumber}</li> | ||
<li>Application ID: ${applicationId}</li> | ||
</ul> | ||
`, | ||
}; | ||
}; | ||
|
||
export default notifyFailedReadOfTemplateData; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.