aboutsummaryrefslogtreecommitdiffstats
path: root/python/report_ops/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/report_ops/utils.py')
-rw-r--r--python/report_ops/utils.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/python/report_ops/utils.py b/python/report_ops/utils.py
index b1135810..fd2e7aeb 100644
--- a/python/report_ops/utils.py
+++ b/python/report_ops/utils.py
@@ -543,6 +543,46 @@ class QuantifiMonitor(
)
+class CitcoMonitor(
+ Monitor,
+ headers=(
+ "process_date",
+ "submit_date",
+ "identifier_type",
+ "citco_id",
+ "serenitas_id",
+ ),
+ num_format=[],
+):
+ @classmethod
+ def email(cls, filename, buf):
+ if not cls._staging_queue:
+ return
+ cls._em.send_email(
+ f"(CITCO) UPLOAD REPORT: {filename} ",
+ 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",
+ ),
+ attach=[FileAttachment(name=filename + ".csv", content=buf)],
+ )
+
+
@dataclass
class EmailOps:
_em = ExchangeMessage()