Minor fixes. Cleaned up logging and send_email test mode.

This commit is contained in:
Scott Idem
2024-10-01 15:04:12 -04:00
parent 58e331f85c
commit aade8504fa
4 changed files with 96 additions and 41 deletions

View File

@@ -24,7 +24,7 @@ router = APIRouter()
async def util_email_send_obj(
email_send_obj: Email_Send_Base,
test: bool = False,
test: Optional[bool] = False,
return_obj: bool = True,
@@ -56,7 +56,18 @@ async def util_email_send_obj(
# NOTE: This all works, but I think it could be done better???
if send_email(from_email=from_email, from_name=from_name, to_email=to_email, to_name=to_name, bcc_email=bcc_email, bcc_name=bcc_name, subject=subject, body_text=body_text, body_html=body_html, test=test):
if send_email(
from_email = from_email,
from_name = from_name,
to_email = to_email,
to_name = to_name,
bcc_email = bcc_email,
bcc_name = bcc_name,
subject = subject,
body_text = body_text,
body_html = body_html,
test = test
):
status_code = 200
status_message = f'Email was sent to <{to_email}>.'
else: