Update email.py

This commit is contained in:
zandercymatics 2024-06-10 14:38:00 -06:00
parent 4d8d722375
commit cb9c4b3f57
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7

View file

@ -109,13 +109,13 @@ def wrap_text_and_preserve_paragraphs(text, width):
str: Wrapped text with preserved paragraph structure.
"""
# Split text into paragraphs by newlines
paragraphs = text.split('\n')
paragraphs = text.split("\n")
# Add \n to any line that exceeds our max length
wrapped_paragraphs = [textwrap.fill(paragraph, width=width) for paragraph in paragraphs]
# Join paragraphs with double newlines
return '\n'.join(wrapped_paragraphs)
return "\n".join(wrapped_paragraphs)
def send_email_with_attachment(sender, recipient, subject, body, attachment_file, ses_client):