toggle email wrap

This commit is contained in:
zandercymatics 2024-10-02 11:26:56 -06:00
parent db0d4a1eb2
commit 2766202952
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
2 changed files with 4 additions and 2 deletions

View file

@ -683,6 +683,7 @@ class DomainRequest(TimeStampedModel):
"reason": self.action_needed_reason,
"email": self.action_needed_reason_email,
"excluded_reasons": [DomainRequest.ActionNeededReasons.OTHER],
"wrap_email": True,
},
self.DomainRequestStatus.REJECTED: {
"cached_reason": self._cached_rejection_reason,
@ -690,6 +691,7 @@ class DomainRequest(TimeStampedModel):
"email": self.rejection_reason_email,
"excluded_reasons": [],
# "excluded_reasons": [DomainRequest.RejectionReasons.OTHER],
"wrap_email": False,
},
}
status_info = status_information.get(status)
@ -713,7 +715,7 @@ class DomainRequest(TimeStampedModel):
email_template_subject="emails/status_change_subject.txt",
bcc_address=bcc_address,
custom_email_content=status_info.get("email"),
wrap_email=True,
wrap_email=status_information.get("wrap_email"),
)
def sync_yes_no_form_fields(self):

View file

@ -78,7 +78,7 @@ def send_templated_email(
# Wrap the email body to a maximum width of 80 characters per line.
# Not all email clients support CSS to do this, and our .txt files require parsing.
if wrap_email:
email_body = wrap_text_and_preserve_paragraphs(email_body, width=110)
email_body = wrap_text_and_preserve_paragraphs(email_body, width=80)
ses_client.send_email(
FromEmailAddress=settings.DEFAULT_FROM_EMAIL,