diff --git a/pylookyloo/api.py b/pylookyloo/api.py index d730d8e..5916502 100644 --- a/pylookyloo/api.py +++ b/pylookyloo/api.py @@ -460,4 +460,11 @@ def get_modules_responses(self, tree_uuid: str) -> Dict[str, Any]: :param capture_uuid: UUID of the capture ''' r = self.session.get(urljoin(self.root_url, str(PurePosixPath('json', tree_uuid, 'modules')))) - return r.json() \ No newline at end of file + return r.json() + + def send_mail(self, tree_uuid: str, email: str = '', comment: str | None = None) -> bool | dict[str, Any]: + to_send = {'email': email} + if comment: + to_send['comment'] = comment + r = self.session.post(urljoin(self.root_url, str(PurePosixPath('json', tree_uuid, 'report'))), json=to_send) + return r.json()