diff options
Diffstat (limited to 'python/report_ops/utils.py')
| -rw-r--r-- | python/report_ops/utils.py | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/python/report_ops/utils.py b/python/report_ops/utils.py index 54f25526..5b0c14a7 100644 --- a/python/report_ops/utils.py +++ b/python/report_ops/utils.py @@ -502,6 +502,46 @@ class FxHedge( ) +class QuantifiMonitor( + Monitor, + headers=( + "uploadtime", + "filename", + "errors", + "warnings", + "successes", + "total", + ), + num_format=[], +): + @classmethod + def email(cls, filename, errors): + if not cls._staging_queue: + return + cls._em.send_email( + f"Quantifi Report: {filename} {'**Errors**' if errors else ''}", + HTMLBody( + f""" +<html> + <head> + <style> + table, th, td {{ border: 1px solid black; border-collapse: collapse;}} + th, td {{ padding: 5px; }} + </style> + </head> + <body> + {cls.to_tabulate()} + </body> +</html>""" + ), + to_recipients=( + "fyu@lmcg.com", + "ghorel@lmcg.com", + "etsui@lmcg.com", + ), + ) + + @dataclass class EmailOps: _em = ExchangeMessage() |
