-
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.
feat(upload-sub-doc-email): Add template for upload subsequent docume…
…nts CHIP SPA (#878) * working through email content * adjust text language * added missing preview emails * add email logic for subseq doc * fix types * remove unused * Update ChipSpaCMS.tsx * remove unused * Delete CHIP_SPA.tsx * adjust template * adjust based on comments * Update ChipSpaState.tsx --------- Co-authored-by: Andie Swift <andie.swift5@gmail.com>
- Loading branch information
1 parent
cab225c
commit 666cc2f
Showing
10 changed files
with
220 additions
and
3 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
47 changes: 47 additions & 0 deletions
47
lib/libs/email/content/upload-subsequent-documents/emailTemplates/ChipSpaCMS.tsx
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,47 @@ | ||
import { CommonEmailVariables, Events } from "shared-types"; | ||
import { PackageDetails, BasicFooter, Attachments } from "../../email-components"; | ||
import { BaseEmailTemplate } from "../../email-templates"; | ||
import { styles } from "../../email-styles"; | ||
import { Text } from "@react-email/components"; | ||
|
||
export const ChipSpaCMSEmail = (props: { | ||
variables: Events["UploadSubsequentDocuments"] & CommonEmailVariables; | ||
}) => { | ||
const variables = props.variables; | ||
const previewText = `Action required: review new documents for CHIP SPA ${variables.id} in OneMAC.`; | ||
const heading = `New documents have been submitted for CHIP SPA ${variables.id} in OneMAC.`; | ||
return ( | ||
<BaseEmailTemplate | ||
previewText={previewText} | ||
heading={heading} | ||
applicationEndpointUrl={variables.applicationEndpointUrl} | ||
footerContent={<BasicFooter />} | ||
> | ||
<PackageDetails | ||
details={{ | ||
"State or territory": variables.territory, | ||
"CHIP SPA Package ID": variables.id, | ||
Summary: variables.additionalInformation, | ||
}} | ||
/> | ||
<Attachments attachments={variables.attachments} /> | ||
<Text style={{ ...styles.text.base, marginTop: "16px", fontWeight: "bold" }}> | ||
How to Access: | ||
</Text> | ||
<Text style={{ ...styles.text.base, marginTop: "16px", marginLeft: "16px" }}> | ||
• These documents can be found in OneMAC through this link{" "} | ||
<a href={variables.applicationEndpointUrl} target="_blank"> | ||
{variables.applicationEndpointUrl} | ||
</a> | ||
</Text> | ||
<Text style={{ ...styles.text.base, marginTop: "16px", marginLeft: "16px" }}> | ||
• If you are not already logged in, click “Login” at the top of the page and log in using | ||
your Enterprise User Administration (EUA) credentials. | ||
</Text> | ||
<Text style={{ ...styles.text.base, marginTop: "16px", marginLeft: "16px" }}> | ||
• After you logged in, click the submission ID number on the dashboard page to view details. | ||
</Text> | ||
<Text style={{ ...styles.text.base, marginTop: "16px" }}>Thank you.</Text> | ||
</BaseEmailTemplate> | ||
); | ||
}; |
44 changes: 44 additions & 0 deletions
44
lib/libs/email/content/upload-subsequent-documents/emailTemplates/ChipSpaState.tsx
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,44 @@ | ||
import { Events } from "shared-types"; | ||
import { CommonEmailVariables } from "shared-types"; | ||
import { Text } from "@react-email/components"; | ||
import { | ||
PackageDetails, | ||
ContactStateLead, | ||
DetailsHeading, | ||
Attachments, | ||
} from "../../email-components"; | ||
import { BaseEmailTemplate } from "../../email-templates"; | ||
import { styles } from "../../email-styles"; | ||
|
||
export const ChipSpaStateEmail = (props: { | ||
variables: Events["UploadSubsequentDocuments"] & CommonEmailVariables; | ||
}) => { | ||
const variables = props.variables; | ||
const previewText = `Additional documents submitted for CHIP SPA ${variables.id}`; | ||
const heading = `You’ve successfully submitted the following to CMS reviewers for CHIP SPA ${variables.id}`; | ||
|
||
return ( | ||
<BaseEmailTemplate | ||
previewText={previewText} | ||
heading={heading} | ||
applicationEndpointUrl={variables.applicationEndpointUrl} | ||
footerContent={<ContactStateLead isChip />} | ||
> | ||
<DetailsHeading /> | ||
<PackageDetails | ||
details={{ | ||
"State or territory": variables.territory, | ||
Name: variables.submitterName, | ||
"Email Address": variables.submitterEmail, | ||
"CHIP SPA Package ID": variables.id, | ||
Summary: variables.additionalInformation, | ||
}} | ||
/> | ||
<Attachments attachments={variables.attachments} /> | ||
<Text style={{ ...styles.text.base, marginTop: "16px" }}> | ||
If you have questions or did not expect this email, please contact your CPOC. | ||
</Text> | ||
<Text style={{ ...styles.text.base, marginTop: "16px" }}>Thank you.</Text> | ||
</BaseEmailTemplate> | ||
); | ||
}; |
2 changes: 2 additions & 0 deletions
2
lib/libs/email/content/upload-subsequent-documents/emailTemplates/index.tsx
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,2 @@ | ||
export { ChipSpaCMSEmail } from "./ChipSpaCMS"; | ||
export { ChipSpaStateEmail } from "./ChipSpaState"; |
30 changes: 30 additions & 0 deletions
30
lib/libs/email/content/upload-subsequent-documents/index.tsx
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,30 @@ | ||
import { Events, Authority, EmailAddresses, CommonEmailVariables } from "shared-types"; | ||
import { AuthoritiesWithUserTypesTemplate } from "../.."; | ||
import { ChipSpaCMSEmail, ChipSpaStateEmail } from "./emailTemplates"; | ||
import { render } from "@react-email/render"; | ||
|
||
export const uploadSubsequentDocuments: AuthoritiesWithUserTypesTemplate = { | ||
[Authority.CHIP_SPA]: { | ||
cms: async ( | ||
variables: Events["UploadSubsequentDocuments"] & | ||
CommonEmailVariables & { emails: EmailAddresses }, | ||
) => { | ||
return { | ||
to: variables.emails.chipInbox, | ||
cc: variables.emails.chipCcList, | ||
subject: `Action required: review new documents for ${variables.actionType + variables.id}`, | ||
body: await render(<ChipSpaCMSEmail variables={variables} />), | ||
}; | ||
}, | ||
state: async ( | ||
variables: Events["UploadSubsequentDocuments"] & | ||
CommonEmailVariables & { emails: EmailAddresses }, | ||
) => { | ||
return { | ||
to: [`${variables.submitterName} <${variables.submitterEmail}>`], | ||
subject: `Additional documents submitted for ${variables.actionType + variables.id}`, | ||
body: await render(<ChipSpaStateEmail variables={variables} />), | ||
}; | ||
}, | ||
}, | ||
}; |
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,41 @@ | ||
export const emailTemplateValue = { | ||
territory: "CO", | ||
applicationEndpointUrl: "https://mako-dev.cms.gov/", | ||
actionType: "Upload-Subsequent-Documents", | ||
origin: "mako" as const, | ||
requestedDate: Date.now() - 5 * 24 * 60 * 60, | ||
withdrawnDate: Date.now(), | ||
attachments: { | ||
cmsForm179: { | ||
files: [ | ||
{ | ||
filename: "withdraw-documentation.pdf", | ||
title: "withdraw-documentation", | ||
bucket: "mako-outbox-attachments-635052997545", | ||
key: "b545ea14-6b1b-47c0-a374-743fcba4391f.pdf", | ||
uploadDate: 1728493782785, | ||
}, | ||
], | ||
label: "CMS Form 179", | ||
}, | ||
spaPages: { | ||
files: [ | ||
{ | ||
filename: "Addditional Information.pdf", | ||
title: "Addditional Information", | ||
bucket: "mako-outbox-attachments-635052997545", | ||
key: "f581c0ec-cbb2-4875-a384-86c06136f4c4.pdf", | ||
uploadDate: 1728493784252, | ||
}, | ||
], | ||
label: "SPA Pages", | ||
}, | ||
}, | ||
additionalInformation: | ||
"This some additional infornormaiton about the request to withdraw and what makes it important.", | ||
submitterName: "George Harrison", | ||
submitterEmail: "george@example.com", | ||
timestamp: 1723390633663, | ||
event: "upload-subsequent-documents" as const, | ||
id: "CA-10001-0003", | ||
}; |
27 changes: 27 additions & 0 deletions
27
lib/libs/email/preview/Upload Subsequent Documents/CMS/CHIP_SPA.tsx
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,27 @@ | ||
import { ChipSpaCMSEmail } from "lib/libs/email/content/upload-subsequent-documents/emailTemplates/ChipSpaCMS"; | ||
import { emailTemplateValue } from "lib/libs/email/mock-data/upload-subsequent-documents"; | ||
import * as attachments from "lib/libs/email/mock-data/attachments"; | ||
|
||
const ChipSpaCMSEmailPreview = () => { | ||
return ( | ||
<ChipSpaCMSEmail | ||
variables={{ | ||
...emailTemplateValue, | ||
id: "CO-24-1234", | ||
event: "upload-subsequent-documents", | ||
actionType: "Amend", | ||
attachments: { | ||
currentStatePlan: attachments.currentStatePlan, | ||
amendedLanguage: attachments.amendedLanguage, | ||
coverLetter: attachments.coverLetter, | ||
budgetDocuments: attachments.budgetDocuments, | ||
publicNotice: attachments.publicNotice, | ||
tribalConsultation: attachments.tribalConsultation, | ||
other: attachments.other, | ||
}, | ||
}} | ||
/> | ||
); | ||
}; | ||
|
||
export default ChipSpaCMSEmailPreview; |
26 changes: 26 additions & 0 deletions
26
lib/libs/email/preview/Upload Subsequent Documents/State/CHIP_SPA.tsx
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,26 @@ | ||
import { emailTemplateValue } from "lib/libs/email/mock-data/upload-subsequent-documents"; | ||
import { ChipSpaStateEmail } from "lib/libs/email/content/upload-subsequent-documents/emailTemplates"; | ||
import * as attachments from "lib/libs/email/mock-data/attachments"; | ||
const ChipSpaStateEmailPreview = () => { | ||
return ( | ||
<ChipSpaStateEmail | ||
variables={{ | ||
...emailTemplateValue, | ||
id: "CO-24-1234", | ||
event: "upload-subsequent-documents", | ||
actionType: "Amend", | ||
attachments: { | ||
currentStatePlan: attachments.currentStatePlan, | ||
amendedLanguage: attachments.amendedLanguage, | ||
coverLetter: attachments.coverLetter, | ||
budgetDocuments: attachments.budgetDocuments, | ||
publicNotice: attachments.publicNotice, | ||
tribalConsultation: attachments.tribalConsultation, | ||
other: attachments.other, | ||
}, | ||
}} | ||
/> | ||
); | ||
}; | ||
|
||
export default ChipSpaStateEmailPreview; |
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