Repository: cisagov/manage.get.gov

Issue:
Remove email notification for requests changing to "In Review" and "Action Needed" states.
Upon review and user feedback, there is no benefit in notification to the user when a request enters the "In Review" status, as this is an internal change.

Similarly, when a request is returned to the requestor with "Action Needed," an email detailing the required action is sent. There is no need to send another notification of this status change.

AC:

- [ ] Email notification for status change to "In Review" is removed.
- [ ] Email notification for status change to "Action Needed" is removed.

Related to: #1489 


Discussion:

Resolving patch:
diff --git a/src/registrar/models/domain_application.py b/src/registrar/models/domain_application.py
--- a/src/registrar/models/domain_application.py
+++ b/src/registrar/models/domain_application.py
@@ -653,13 +653,11 @@ def submit(self):
     def in_review(self):
         """Investigate an application that has been submitted.
 
-        As a side effect, an email notification is sent."""
-
-        self._send_status_update_email(
-            "application in review",
-            "emails/status_change_in_review.txt",
-            "emails/status_change_in_review_subject.txt",
-        )
+        This action is logged."""
+        literal = DomainApplication.ApplicationStatus.IN_REVIEW
+        # Check if the tuple exists, then grab its value
+        in_review = literal if literal is not None else "In Review"
+        logger.info(f"A status change occurred. {self} was changed to '{in_review}'")
 
     @transition(
         field="status",
@@ -674,13 +672,11 @@ def in_review(self):
     def action_needed(self):
         """Send back an application that is under investigation or rejected.
 
-        As a side effect, an email notification is sent."""
-
-        self._send_status_update_email(
-            "action needed",
-            "emails/status_change_action_needed.txt",
-            "emails/status_change_action_needed_subject.txt",
-        )
+        This action is logged."""
+        literal = DomainApplication.ApplicationStatus.ACTION_NEEDED
+        # Check if the tuple is setup correctly, then grab its value
+        action_needed = literal if literal is not None else "Action Needed"
+        logger.info(f"A status change occurred. {self} was changed to '{action_needed}'")
 
     @transition(
         field="status",
diff --git a/src/registrar/views/application.py b/src/registrar/views/application.py
--- a/src/registrar/views/application.py
+++ b/src/registrar/views/application.py
@@ -153,6 +153,7 @@ def application(self) -> DomainApplication:
     def storage(self):
         # marking session as modified on every access
         # so that updates to nested keys are always saved
+        # push to sandbox will remove
         self.request.session.modified = True
         return self.request.session.setdefault(self.prefix, {})
 


Test patch:
diff --git a/src/registrar/tests/test_admin.py b/src/registrar/tests/test_admin.py
--- a/src/registrar/tests/test_admin.py
+++ b/src/registrar/tests/test_admin.py
@@ -457,44 +457,6 @@ def test_save_model_sends_submitted_email(self):
 
         self.assertEqual(len(self.mock_client.EMAILS_SENT), 1)
 
-    @boto3_mocking.patching
-    def test_save_model_sends_in_review_email(self):
-        # make sure there is no user with this email
-        EMAIL = "mayor@igorville.gov"
-        User.objects.filter(email=EMAIL).delete()
-
-        with boto3_mocking.clients.handler_for("sesv2", self.mock_client):
-            with less_console_noise():
-                # Create a sample application
-                application = completed_application(status=DomainApplication.ApplicationStatus.SUBMITTED)
-
-                # Create a mock request
-                request = self.factory.post("/admin/registrar/domainapplication/{}/change/".format(application.pk))
-
-                # Modify the application's property
-                application.status = DomainApplication.ApplicationStatus.IN_REVIEW
-
-                # Use the model admin's save_model method
-                self.admin.save_model(request, application, form=None, change=True)
-
-        # Access the arguments passed to send_email
-        call_args = self.mock_client.EMAILS_SENT
-        kwargs = call_args[0]["kwargs"]
-
-        # Retrieve the email details from the arguments
-        from_email = kwargs.get("FromEmailAddress")
-        to_email = kwargs["Destination"]["ToAddresses"][0]
-        email_content = kwargs["Content"]
-        email_body = email_content["Simple"]["Body"]["Text"]["Data"]
-
-        # Assert or perform other checks on the email details
-        expected_string = "Your .gov domain request is being reviewed."
-        self.assertEqual(from_email, settings.DEFAULT_FROM_EMAIL)
-        self.assertEqual(to_email, EMAIL)
-        self.assertIn(expected_string, email_body)
-
-        self.assertEqual(len(self.mock_client.EMAILS_SENT), 1)
-
     @boto3_mocking.patching
     def test_save_model_sends_approved_email(self):
         # make sure there is no user with this email
@@ -556,44 +518,6 @@ def test_save_model_sets_approved_domain(self):
         # Test that approved domain exists and equals requested domain
         self.assertEqual(application.requested_domain.name, application.approved_domain.name)
 
-    @boto3_mocking.patching
-    def test_save_model_sends_action_needed_email(self):
-        # make sure there is no user with this email
-        EMAIL = "mayor@igorville.gov"
-        User.objects.filter(email=EMAIL).delete()
-
-        with boto3_mocking.clients.handler_for("sesv2", self.mock_client):
-            with less_console_noise():
-                # Create a sample application
-                application = completed_application(status=DomainApplication.ApplicationStatus.IN_REVIEW)
-
-                # Create a mock request
-                request = self.factory.post("/admin/registrar/domainapplication/{}/change/".format(application.pk))
-
-                # Modify the application's property
-                application.status = DomainApplication.ApplicationStatus.ACTION_NEEDED
-
-                # Use the model admin's save_model method
-                self.admin.save_model(request, application, form=None, change=True)
-
-        # Access the arguments passed to send_email
-        call_args = self.mock_client.EMAILS_SENT
-        kwargs = call_args[0]["kwargs"]
-
-        # Retrieve the email details from the arguments
-        from_email = kwargs.get("FromEmailAddress")
-        to_email = kwargs["Destination"]["ToAddresses"][0]
-        email_content = kwargs["Content"]
-        email_body = email_content["Simple"]["Body"]["Text"]["Data"]
-
-        # Assert or perform other checks on the email details
-        expected_string = "We've identified an action needed to complete the review of your .gov domain request."
-        self.assertEqual(from_email, settings.DEFAULT_FROM_EMAIL)
-        self.assertEqual(to_email, EMAIL)
-        self.assertIn(expected_string, email_body)
-
-        self.assertEqual(len(self.mock_client.EMAILS_SENT), 1)
-
     @boto3_mocking.patching
     def test_save_model_sends_rejected_email(self):
         # make sure there is no user with this email
diff --git a/src/registrar/tests/test_models.py b/src/registrar/tests/test_models.py
--- a/src/registrar/tests/test_models.py
+++ b/src/registrar/tests/test_models.py
@@ -268,14 +268,12 @@ def test_action_needed_transition_allowed(self):
             (self.ineligible_application, TransitionNotAllowed),
         ]
 
-        with boto3_mocking.clients.handler_for("sesv2", self.mock_client):
-            with less_console_noise():
-                for application, exception_type in test_cases:
-                    with self.subTest(application=application, exception_type=exception_type):
-                        try:
-                            application.action_needed()
-                        except TransitionNotAllowed:
-                            self.fail("TransitionNotAllowed was raised, but it was not expected.")
+        for application, exception_type in test_cases:
+            with self.subTest(application=application, exception_type=exception_type):
+                try:
+                    application.action_needed()
+                except TransitionNotAllowed:
+                    self.fail("TransitionNotAllowed was raised, but it was not expected.")
 
     def test_action_needed_transition_not_allowed(self):
         """
@@ -288,12 +286,10 @@ def test_action_needed_transition_not_allowed(self):
             (self.withdrawn_application, TransitionNotAllowed),
         ]
 
-        with boto3_mocking.clients.handler_for("sesv2", self.mock_client):
-            with less_console_noise():
-                for application, exception_type in test_cases:
-                    with self.subTest(application=application, exception_type=exception_type):
-                        with self.assertRaises(exception_type):
-                            application.action_needed()
+        for application, exception_type in test_cases:
+            with self.subTest(application=application, exception_type=exception_type):
+                with self.assertRaises(exception_type):
+                    application.action_needed()
 
     def test_approved_transition_allowed(self):
         """