Skip to content

Commit

Permalink
fix(emails): Email IDM branch (#680)
Browse files Browse the repository at this point in the history
* made minor text changes, have not tested yet

* compared and made the same as the confluence where possible, added the text files, also did a minor rearrange so that it follows cms -> state pattern

* merged master & changed email for testing purposes

* trying this to get emails to my personal

* added missing appK title key for Ammendment title

* added a switch just for appK title

* changing the appK title logic because I broke it

* removed whole appK case bc I think that broke it?

* removed my email that was there for testing because I dont need it anymore

* fixed extra tag and changed to a value we have

* putting appKtitle back

* added appKtitle to dataLIst

* lowercase K for appk and removed my email

* cleaned up a little

* changed intial waiver to actionType variable

* fixed minor text change missing the variable actionType and matched text for appK

* corrected email template text for temporary-extension-state template according to templates confluence page

* fixed text for waiver withdraw state email

* fixed text on withdraw-rai-1915b-state

* added missing TE type variable

* oy2-28874: added other text for empty summary

* removed duplicate lines as per Hannas Jira comment

* Oy2 28892 - fix 1915(c) emails (#692)

* make waiver withdraw and respond to rai generic across 1915b and 1915c

* remove unused var causing cms withdraw emails to fail

* Oy2 28896 (#681)

* added cpoc to ToAddresses for waiver/medecaid related email templates
* correct email templates toAddresses as per Email Notification Confluence
Co-authored-by: Andie Swift <[email protected]>

* merged main

* deleted src to match master

* withdraw chip rai - added the cms reciepents to datalist & added cognito to lookup list to fix issue where no email isnt being sent

---------

Co-authored-by: Benjamin Paige <[email protected]>
Co-authored-by: Alex Youssefinia <[email protected]>
Co-authored-by: bflynn-cms <[email protected]>
  • Loading branch information
4 people authored Aug 22, 2024
1 parent 08e0d72 commit 09a6e85
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 33 deletions.
42 changes: 21 additions & 21 deletions lib/lambda/ses-email-templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ [email protected] or your state lead.
Thank you!`,
},
{
name: "withdraw-package-1915b-cms",
name: "withdraw-package-waiver-cms",
subject: "Waiver Package {{id}} Withdraw Request",
html: `
<p>The OneMAC Submission Portal received a request to withdraw the package below.
Expand All @@ -264,34 +264,34 @@ Summary:
<p>If the contents of this email seem suspicious, do not open them, and instead
forward this email to <a href='mailto:[email protected]'>[email protected]</a>.</p>
<p>Thank you!</p>`,
text: `
he OneMAC Submission Portal received a request to withdraw the package below.
text: `
The OneMAC Submission Portal received a request to withdraw the package below.
The package will no longer be considered for CMS review:
State or territory: {{territory}}
Name: {{submitterName}}
Email: {{submitterEmail}}
{{actionType}} Number: {{id}}
Waiver Number: {{id}}
Summary:
{{additionalInformation}}
If the contents of this email seem suspicious, do not open them, and instead forward this email to [email protected].
Thank you!`
Thank you!`,
},
{
name: "withdraw-package-1915b-state",
subject: "1915(b) Waiver {{id}} Withdrawal Confirmation",
name: "withdraw-package-waiver-state",
subject: "{{authority}} Waiver {{id}} Withdrawal Confirmation",
html: `
<p>This email is to confirm 1915(b) Waiver {{id}} was withdrawn
by {{submitterName}}. The review of 1915(b) Waiver {{id}} has concluded.</p>
<p>This email is to confirm {{authority}} Waiver {{id}} was withdrawn
by {{submitterName}}. The review of {{authority}} Waiver {{id}} has concluded.</p>
<p>If you have questions, please contact
<a href='mailto:[email protected]'>[email protected]</a> or your state lead.</p>
<p>Thank you!</p>`,
text: `
This email is to confirm 1915(b) Waiver {{id}} was withdrawn by {{submitterName}}.
The review of 1915(b) Waiver {{id}} has concluded.
This email is to confirm {{authority}} Waiver {{id}} was withdrawn by {{submitterName}}.
The review of {{authority}} Waiver {{id}} has concluded.
If you have questions, please contact [email protected] or your state lead.
Expand Down Expand Up @@ -529,7 +529,7 @@ Any other correspondence will be disregarded.
If you have any questions, please contact [email protected] or your state lead.
Thank you!`
Thank you!`,
},
{
name: "withdraw-rai-1915b-state",
Expand Down Expand Up @@ -572,7 +572,7 @@ Any other correspondence will be disregarded.
If you have any questions, please contact [email protected] or your state lead.
Thank you!`
Thank you!`,
},
{
name: "withdraw-package-medicaid-spa-cms",
Expand Down Expand Up @@ -967,10 +967,10 @@ If you have any questions, please contact [email protected] o
Thank you!`,
},
{
name: "respond-to-rai-1915b-cms",
name: "respond-to-rai-waiver-cms",
subject: "Waiver RAI Response for {{id}} Submitted",
html: `
<p>The OneMAC Submission Portal received a 1915(b) Waiver RAI Response Submission:</p>
<p>The OneMAC Submission Portal received a {{authority}} Waiver RAI Response Submission:</p>
<ul>
<li>The submission can be accessed in the OneMAC application, which you
can find at <a href='{{applicationEndpoint}}'>this link</a>.</li>
Expand All @@ -996,7 +996,7 @@ Summary:
forward this email to <a href='mailto:[email protected]'>[email protected]</a>.</p>
<p>Thank you!</p>`,
text: `
The OneMAC Submission Portal received a 1915(b) Waiver RAI Response Submission:
The OneMAC Submission Portal received a {{authority}} Waiver RAI Response Submission:
- The submission can be accessed in the OneMAC application, which you can
find at {{applicationEndpoint}}.
Expand Down Expand Up @@ -1024,11 +1024,11 @@ forward this email to [email protected].
Thank you!`,
},
{
name: "respond-to-rai-1915b-state",
name: "respond-to-rai-waiver-state",
subject:
"Your 1915(b) Waiver RAI Response for {{id}} has been submitted to CMS",
"Your {{authority}} Waiver RAI Response for {{id}} has been submitted to CMS",
html: `
<p>This response confirms the submission of your 1915(b) Waiver RAI Response to CMS for review:</p>
<p>This response confirms the submission of your {{authority}} Waiver RAI Response to CMS for review:</p>
<p>
<br><b>State or territory:</b> {{territory}}
<br><b>Name:</b> {{submitterName}}
Expand All @@ -1053,7 +1053,7 @@ requests on Waivers only. Any other correspondence will be disregarded.
or your state lead.</p>
<p>Thank you!</p>`,
text: `
This response confirms the submission of your 1915(b) Waiver RAI Response to CMS for review:
This response confirms the submission of your {{authority}} Waiver RAI Response to CMS for review:
State or territory: {{territory}}
Name: {{submitterName}}
Expand Down Expand Up @@ -1231,7 +1231,7 @@ Thank you!`,
name: "temporary-extension-cms",
subject: "{{authority}} Waiver Extension {{id}} Submitted",
html: `
<p>The Submission Portal received a {{authority}} Waiver Extension Submission:</p>
<p>The OneMAC Submission Portal received a {{authority}} Waiver Extension Submission:</p>
<ul>
<li>The submission can be accessed in the OneMAC application, which you
can find at <a href='{{applicationEndpoint}}'>this link</a>.</li>
Expand Down
23 changes: 14 additions & 9 deletions lib/libs/email/bundle-lib.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Action } from "shared-types";
import { Action } from "../../packages/shared-types";
import { DecodedRecord } from "./handler-lib";

interface EmailCommand {
Expand Down Expand Up @@ -83,6 +83,7 @@ const getBundleFromEvent = (
],
};
case "respond-to-rai-1915b":
case "respond-to-rai-1915c":
return {
lookupList: ["osInsights"],
dataList: [
Expand All @@ -104,16 +105,17 @@ const getBundleFromEvent = (
],
emailCommands: [
{
Template: `respond-to-rai-1915b-cms_${stage}`,
Template: `respond-to-rai-waiver-cms_${stage}`,
ToAddresses: ["osgEmail", "cpoc", "srt", "dmcoEmail"],
},
{
Template: `respond-to-rai-1915b-state_${stage}`,
Template: `respond-to-rai-waiver-state_${stage}`,
ToAddresses: ["submitter"],
},
],
};
case "withdraw-package-1915b":
case "withdraw-package-1915c":
return {
lookupList: ["osInsights", "cognito"],
dataList: [
Expand All @@ -126,14 +128,15 @@ const getBundleFromEvent = (
"submitterName",
"submitterEmail",
"additionalInformation",
"authority",
],
emailCommands: [
{
Template: `withdraw-package-1915b-cms_${stage}`,
ToAddresses: ["osgEmail", "cpoc", "srt"],
Template: `withdraw-package-waiver-cms_${stage}`,
ToAddresses: ["osgEmail", "cpoc", "srt", "dmcoEmail"],
},
{
Template: `withdraw-package-1915b-state_${stage}`,
Template: `withdraw-package-waiver-state_${stage}`,
ToAddresses: ["allState"],
},
],
Expand Down Expand Up @@ -244,7 +247,7 @@ const getBundleFromEvent = (
emailCommands: [
{
Template: `new-submission-chip-spa-cms_${stage}`,
ToAddresses: ["osgEmail", "chipInbox"],
ToAddresses: ["chipInbox"],
CcAddresses: ["chipCcList"],
},
{
Expand All @@ -255,7 +258,7 @@ const getBundleFromEvent = (
};
case "respond-to-rai-chip-spa":
return {
lookupList: ["osInsights"],
lookupList: ["osInsights", "cognito"],
dataList: [
"osgEmail",
"chipInbox",
Expand All @@ -271,11 +274,13 @@ const getBundleFromEvent = (
"additionalInformation",
"formattedFileList",
"textFileList",
"srt",
"cpoc",
],
emailCommands: [
{
Template: `respond-to-rai-chip-spa-cms_${stage}`,
ToAddresses: ["osgEmail", "chipInbox"],
ToAddresses: ["srt", "chipInbox", "cpoc"],
CcAddresses: ["chipCcList"],
},
{
Expand Down
9 changes: 6 additions & 3 deletions lib/libs/email/data-lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
AttachmentKey,
attachmentTitleMap,
EmailAddresses,
} from "shared-types";
import { getSecret } from "shared-utils";
} from "../../packages/shared-types";
import { getSecret } from "../../packages/shared-utils";

interface Attachment {
title: keyof typeof attachmentTitleMap;
Expand Down Expand Up @@ -171,7 +171,10 @@ export const buildEmailData = async (
emailAddresses[dataType] ??
`'${dataType} Substitute' <[email protected]>`;
break;

case "additionalInformation":
returnObject[dataType] =
data[dataType] ?? "No additional information submitted";
break;
default:
returnObject[dataType] =
data[dataType] ?? lookupValues[dataType] ?? "missing data";
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"cdk-serverless-clamscan": "^2.8.1",
"constructs": "^10.3.0",
"esbuild": "^0.21.5",
"luxon": "^3.5.0",
"source-map-support": "^0.5.21",
"tsx": "4.15.7"
},
Expand All @@ -49,6 +50,7 @@
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@types/jest": "^29.5.12",
"@types/luxon": "^3.4.2",
"@types/node": "20.14.2",
"@vitest/coverage-c8": "^0.29.8",
"@vitest/coverage-istanbul": "^2.0.5",
Expand Down

0 comments on commit 09a6e85

Please sign in to comment.