def notify_email()

in mozci/util/taskcluster.py [0:0]


def notify_email(subject, content, emails):
    """
    Send an email to all provided email addresses
    using Taskcluster notify service
    """
    if not emails:
        logger.warning("No email address available in configuration")
        return

    notify_service = taskcluster.Notify(get_taskcluster_options())
    for idx, email in enumerate(emails):
        try:
            notify_service.email(
                {
                    "address": email,
                    "subject": f"Mozci | {subject}",
                    "content": content,
                }
            )
        except Exception as e:
            logger.error(
                f"Failed to send the report by email to address n°{idx} ({email}): {e}"
            )
            raise