Skip to content

Commit

Permalink
Addd 1915b appks
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminpaige committed Jan 21, 2025
1 parent 0d67751 commit bd656be
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 8 deletions.
15 changes: 11 additions & 4 deletions lib/lambda/processEmailsHandler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const contractingInitial = "contracting-initial";
const capitatedInitial = "capitated-initial";
const withdrawRai = "withdraw-rai";
const respondToRai = "respond-to-rai";
const appk = "app-k";

describe("process emails Handler", () => {
it.each([
Expand Down Expand Up @@ -131,9 +132,9 @@ describe("process emails Handler", () => {
SIMPLE_ID,
],
[
`should send an email for ${withdrawPackage} with ${Authority["1915c"]}`,
`should send an email for ${appk} with ${Authority["1915c"]}`,
Authority["1915c"],
withdrawPackage,
appk,
SIMPLE_ID,
],
[
Expand Down Expand Up @@ -179,9 +180,15 @@ describe("process emails Handler", () => {
SIMPLE_ID,
],
[
`should send an email for ${capitatedInitial} with ${Authority["1915c"]}`,
`should send an email for ${appk} with ${Authority["1915c"]}`,
Authority["1915c"],
capitatedInitial,
appk,
SIMPLE_ID,
],
[
`should send an email for ${appk} with ${Authority["1915b"]}`,
Authority["1915b"],
appk,
SIMPLE_ID,
],
[
Expand Down
22 changes: 18 additions & 4 deletions lib/libs/email/content/newSubmission/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,19 @@ export const newSubmission: AuthoritiesWithUserTypesTemplate = {
| (Events["CapitatedRenewal"] & CommonEmailVariables & { emails: EmailAddresses })
| (Events["ContractingRenewal"] & CommonEmailVariables & { emails: EmailAddresses })
| (Events["CapitatedAmendment"] & CommonEmailVariables & { emails: EmailAddresses })
| (Events["ContractingAmendment"] & CommonEmailVariables & { emails: EmailAddresses }),
| (Events["ContractingAmendment"] & CommonEmailVariables & { emails: EmailAddresses })
| (Events["AppKSubmission"] & CommonEmailVariables & { emails: EmailAddresses }),
) => {
return {
to: variables.emails.osgEmail,
subject: `${variables.authority} ${variables.id} Submitted`,
body: await render(<Waiver1915bCMSEmail variables={variables} />),
body: await render(
variables.event === "app-k" ? (
<AppKCMSEmail variables={variables} />
) : (
<Waiver1915bCMSEmail variables={variables} />
),
),
};
},
state: async (
Expand All @@ -79,12 +86,19 @@ export const newSubmission: AuthoritiesWithUserTypesTemplate = {
| (Events["CapitatedRenewal"] & CommonEmailVariables & { emails: EmailAddresses })
| (Events["ContractingRenewal"] & CommonEmailVariables & { emails: EmailAddresses })
| (Events["CapitatedAmendment"] & CommonEmailVariables & { emails: EmailAddresses })
| (Events["ContractingAmendment"] & CommonEmailVariables & { emails: EmailAddresses }),
| (Events["ContractingAmendment"] & CommonEmailVariables & { emails: EmailAddresses })
| (Events["AppKSubmission"] & CommonEmailVariables & { emails: EmailAddresses }),
) => {
return {
to: [`${variables.submitterName} <${variables.submitterEmail}>`],
subject: `Your ${variables.authority} ${variables.id} has been submitted to CMS`,
body: await render(<Waiver1915bStateEmail variables={variables} />),
body: await render(
variables.event === "app-k" ? (
<AppKCMSEmail variables={variables} />
) : (
<Waiver1915bStateEmail variables={variables} />
),
),
};
},
},
Expand Down

0 comments on commit bd656be

Please sign in to comment.