-
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.
MCR-2541: CMS notified when a state uploads response (#2102)
* send Q&A response emailer function and template. * Add Q&A helpers. * Remove console log. * Use helpers to remove duplicate code. * email notification technical doc. * Change insertQuestionResponse to insert from question via nested writes. Update * Fix update graphQL types to return entire question when creating response. * Update apollo cache for create response mutation and add comments on reason for manual cache update. * Send new response email in resolver. * Some merge fixes and updating tests. * Update error message. * Move getQuestionRound and add and put tests in describe blocks. * Add helpers for mock Q&A data. * Send new response email tests. * Use mock helpers * cypress re-run * Update documentation * Fix test name
- Loading branch information
1 parent
e41bb20
commit 4062b6c
Showing
29 changed files
with
1,008 additions
and
272 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
# Email Notifications | ||
|
||
Certain contract actions in the MC-Review app will initiate email notifications sent to the State and CMS. These actions include: | ||
- New contract submission | ||
- Unlocking a submitted contract | ||
- Resubmitting an unlocked contract | ||
- New Q&A question submitted | ||
- New Q&A response submitted | ||
|
||
The email recipients for each action vary depending on contract data, such as contract type, the state the contract applies to, and the designated state contacts for the contract. The CMS email recipients for contract submission, unlock, and resubmission are generated using the helper function `generateCMSReviewerEmails`. | ||
|
||
### New contract submission | ||
- #### State email receivers: | ||
- **stateContacts**: All contacts in the latest submitted contract revision's `formData.stateContacts`. | ||
- **submitterEmails**: User emails that submitted/resubmitted the contract. In resolvers, `submitterEmails` is generated by `contractSubmitters` function that loops through revisions and adding submitInfo.updatedBy emails to a string array. | ||
- **devReviewTeamEmails**: Dev team email address from parameter store `/configuration/email/reviewTeamAddresses`. | ||
- #### CMS email receivers: | ||
- `CONTRACT_ONLY` submissions | ||
- **devReviewTeamEmails**: Dev team email address from parameter store `/configuration/email/reviewTeamAddresses`. | ||
- **stateAnalystsEmails**: specific state analyst emails from parameter store `/configuration/[STATE]/stateanalysts/email`. | ||
- **dmcpEmails**: DMCP primary inbox from parameter store `/configuration/email/dmcp`. | ||
- `CONTRACT_AND_RATES` submissions | ||
- **devReviewTeamEmails**: Dev team email address from parameter store `/configuration/email/reviewTeamAddresses`. | ||
- **stateAnalystsEmails**: specific state analyst emails from parameter store `/configuration/[STATE]/stateanalysts/email`. | ||
- **dmcpEmails**: DMCP primary inbox from parameter store `/configuration/email/dmcp`. | ||
- **oactEmails**: OACT primary inbox from parameter store `/configuration/email/oact`. | ||
- `CHIP` and State of `PR` submissions | ||
- **devReviewTeamEmails**: Dev team email address from parameter store `/configuration/email/reviewTeamAddresses`. | ||
- **stateAnalystsEmails**: specific state analyst emails from parameter store `/configuration/[STATE]/stateanalysts/email`. | ||
### Unlocking a submitted contract | ||
- #### State email receivers: | ||
- **stateContacts**: All contacts in the latest submitted contract revision's `formData.stateContacts`. | ||
- **submitterEmails**: User emails that submitted/resubmitted the contract. In resolvers, `submitterEmails` is generated by `contractSubmitters` function that loops through revisions and adding submitInfo.updatedBy emails to a string array. | ||
- **devReviewTeamEmails**: Dev team email address from parameter store `/configuration/email/reviewTeamAddresses`. | ||
- #### CMS email receivers: | ||
- `CONTRACT_ONLY` submissions | ||
- **devReviewTeamEmails**: Dev team email address from parameter store `/configuration/email/reviewTeamAddresses`. | ||
- **stateAnalystsEmails**: specific state analyst emails from parameter store `/configuration/[STATE]/stateanalysts/email`. | ||
- **dmcpEmails**: DMCP primary inbox from parameter store `/configuration/email/dmcp`. | ||
- `CONTRACT_AND_RATES` submissions | ||
- **devReviewTeamEmails**: Dev team email address from parameter store `/configuration/email/reviewTeamAddresses`. | ||
- **stateAnalystsEmails**: specific state analyst emails from parameter store `/configuration/[STATE]/stateanalysts/email`. | ||
- **dmcpEmails**: DMCP primary inbox from parameter store `/configuration/email/dmcp`. | ||
- **oactEmails**: OACT primary inbox from parameter store `/configuration/email/oact`. | ||
- `CHIP` and State of `PR` submissions | ||
- **devReviewTeamEmails**: Dev team email address from parameter store `/configuration/email/reviewTeamAddresses`. | ||
- **stateAnalystsEmails**: specific state analyst emails from parameter store `/configuration/[STATE]/stateanalysts/email`. | ||
### Resubmitting an unlocked contract | ||
- #### State email receivers: | ||
- **stateContacts**: All contacts in the latest submitted contract revision's `formData.stateContacts`. | ||
- **submitterEmails**: User emails that submitted/resubmitted the contract. In resolvers, `submitterEmails` is generated by `contractSubmitters` function that loops through revisions and adding submitInfo.updatedBy emails to a string array. | ||
- **devReviewTeamEmails**: Dev team email address from parameter store `/configuration/email/reviewTeamAddresses`. | ||
- #### CMS email receivers: | ||
- `CONTRACT_ONLY` submissions | ||
- **devReviewTeamEmails**: Dev team email address from parameter store `/configuration/email/reviewTeamAddresses`. | ||
- **stateAnalystsEmails**: specific state analyst emails from parameter store `/configuration/[STATE]/stateanalysts/email`. | ||
- **dmcpEmails**: DMCP primary inbox from parameter store `/configuration/email/dmcp`. | ||
- `CONTRACT_AND_RATES` submissions | ||
- **devReviewTeamEmails**: Dev team email address from parameter store `/configuration/email/reviewTeamAddresses`. | ||
- **stateAnalystsEmails**: specific state analyst emails from parameter store `/configuration/[STATE]/stateanalysts/email`. | ||
- **dmcpEmails**: DMCP primary inbox from parameter store `/configuration/email/dmcp`. | ||
- **oactEmails**: OACT primary inbox from parameter store `/configuration/email/oact`. | ||
- `CHIP` and State of `PR` submissions | ||
- **devReviewTeamEmails**: Dev team email address from parameter store `/configuration/email/reviewTeamAddresses`. | ||
- **stateAnalystsEmails**: specific state analyst emails from parameter store `/configuration/[STATE]/stateanalysts/email`. | ||
### New Q&A question submitted | ||
- #### State email receivers: | ||
- **stateContacts**: All contacts in the latest submitted contract revision's `formData.stateContacts`. | ||
- **submitterEmails**: User emails that submitted/resubmitted the contract. In resolvers, `submitterEmails` is generated by `contractSubmitters` function that loops through revisions and adding submitInfo.updatedBy emails to a string array. | ||
- **devReviewTeamEmails**: Dev team email address from parameter store `/configuration/email/reviewTeamAddresses`. | ||
- #### CMS email receivers: | ||
- Questions from `DMCO` | ||
- **devReviewTeamEmails**: Dev team email address from parameter store `/configuration/email/reviewTeamAddresses`. | ||
- **stateAnalystsEmails**: specific state analyst emails from parameter store `/configuration/[STATE]/stateanalysts/email`. | ||
- Questions from `DMCP` | ||
- **devReviewTeamEmails**: Dev team email address from parameter store `/configuration/email/reviewTeamAddresses`. | ||
- **stateAnalystsEmails**: specific state analyst emails from parameter store `/configuration/[STATE]/stateanalysts/email`. | ||
- **dmcpReviewEmails**: DMCP inbox for external communication and Q&A notifications `/configuration/email/dmcpReview`. | ||
- Questions from `OACT` | ||
- **devReviewTeamEmails**: Dev team email address from parameter store `/configuration/email/reviewTeamAddresses`. | ||
- **stateAnalystsEmails**: specific state analyst emails from parameter store `/configuration/[STATE]/stateanalysts/email`. | ||
- **oactEmails**: OACT primary inbox from parameter store `/configuration/email/oact`. | ||
### New Q&A response submitted | ||
- #### State email receivers: | ||
- **stateContacts**: All contacts in the latest submitted contract revision's `formData.stateContacts`. | ||
- **submitterEmails**: User emails that submitted/resubmitted the contract. In resolvers, `submitterEmails` is generated by `contractSubmitters` function that loops through revisions and adding submitInfo.updatedBy emails to a string array. | ||
- **devReviewTeamEmails**: Dev team email address from parameter store `/configuration/email/reviewTeamAddresses`. | ||
- #### CMS email receivers: | ||
- Responses to Questions from `DMCO` | ||
- **devReviewTeamEmails**: Dev team email address from parameter store `/configuration/email/reviewTeamAddresses`. | ||
- **stateAnalystsEmails**: specific state analyst emails from parameter store `/configuration/[STATE]/stateanalysts/email`. | ||
- Responses to Questions from `DMCP` | ||
- **devReviewTeamEmails**: Dev team email address from parameter store `/configuration/email/reviewTeamAddresses`. | ||
- **stateAnalystsEmails**: specific state analyst emails from parameter store `/configuration/[STATE]/stateanalysts/email`. | ||
- **dmcpReviewEmails**: DMCP inbox for external communication and Q&A notifications `/configuration/email/dmcpReview`. | ||
- Responses to Questions from `OACT` | ||
- **devReviewTeamEmails**: Dev team email address from parameter store `/configuration/email/reviewTeamAddresses`. | ||
- **stateAnalystsEmails**: specific state analyst emails from parameter store `/configuration/[STATE]/stateanalysts/email`. | ||
- **oactEmails**: OACT primary inbox from parameter store `/configuration/email/oact`. |
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
11 changes: 11 additions & 0 deletions
11
services/app-api/src/emailer/emails/__snapshots__/sendQuestionResponseCMSEmail.test.ts.snap
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,11 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`renders overall CMS email for a new state response as expected 1`] = ` | ||
"The state submitted responses to OACT's questions about MCR-MN-0003-SNBC<br /> | ||
<b>Submitted by:</b> James Brown <a href="james@example.com">james@example.com</a><br /> | ||
<b>Round:</b> 2<br /> | ||
<b>Questions sent on:</b> 02/03/2024<br /> | ||
<br /> | ||
<a href="http://localhost/submissions/12345/question-and-answers">View submission Q&A</a> | ||
" | ||
`; |
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.