diff options
Diffstat (limited to 'python/report_ops/utils.py')
| -rw-r--r-- | python/report_ops/utils.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/python/report_ops/utils.py b/python/report_ops/utils.py index ff14a294..962efcc5 100644 --- a/python/report_ops/utils.py +++ b/python/report_ops/utils.py @@ -387,8 +387,13 @@ class CitcoMonitor( def email(cls, filename, buf): if not cls._staging_queue: return + recipients = _recipients["NY_CREW"] + action_requested = "" + if cls.check_csm(): + recipients += ("SYamamiya@citco.com", "DataOpsTC@citco.com") + action_requested += "**Action Requested, TradeID Failed**" cls._em.send_email( - f"(CITCO) UPLOAD REPORT: {filename} ", + f"(CITCO) UPLOAD REPORT: {filename} {action_requested}", HTMLBody( f""" <html> @@ -403,10 +408,16 @@ class CitcoMonitor( </body> </html>""" ), - to_recipients=(_recipients["NY_CREW"]), + to_recipients=recipients, attach=[FileAttachment(name=filename, content=buf)], ) + @classmethod + def check_csm(cls): + for line in cls._staging_queue: + if "TID NOT FOUND" in line[3]: + return True + @dataclass class EmailOps: |
