Remove endpoint for email content

We don't really need this. We can just store the email content on the DOM. There is no real performance impact -- its not a lot of content in the grand scheme of things and we'd just be doing a lot of api calls anyway
This commit is contained in:
zandercymatics 2024-06-21 13:02:15 -06:00
parent 5ae8df2bdb
commit abc9fb78bc
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
7 changed files with 36 additions and 44 deletions

View file

@ -1,6 +1,7 @@
from __future__ import annotations
from typing import Union
import logging
import json
from django.apps import apps
from django.conf import settings
@ -1220,6 +1221,15 @@ class DomainRequest(TimeStampedModel):
return True
def get_all_action_needed_reason_emails_as_json(self):
"""Returns a json dictionary of every action needed reason and its associated email
for this particular domain request."""
emails = {}
for action_needed_reason in self.ActionNeededReasons:
enum_value = action_needed_reason.value
emails[enum_value] = self.get_action_needed_reason_default_email_text(enum_value)
return json.dumps(emails)
def get_action_needed_reason_default_email_text(self, action_needed_reason: str):
"""Returns the default email associated with the given action needed reason"""
if action_needed_reason is None or action_needed_reason == self.ActionNeededReasons.OTHER: