import html import boto3 from .. import config def send_notification_email(recipient: str, report_run_name: str): subject = "Collaborator reports ready for download" body = ( f'

Collaborator reports for report run "{html.escape(report_run_name)}" have been ' "generated. You can now download them from the Collaborators app.

" ) client = boto3.client("ses") client.send_email( Source=config.NOTIFICATION_FROM_EMAIL, Destination={ "ToAddresses": [ recipient, ] }, Message={ "Subject": {"Data": subject, "Charset": "utf-8"}, "Body": {"Html": {"Data": body, "Charset": "utf-8"}}, }, ReplyToAddresses=[config.NOTIFICATION_FROM_EMAIL], )