diff options
Diffstat (limited to 'python/globeop_new_strategy.py')
| -rw-r--r-- | python/globeop_new_strategy.py | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/python/globeop_new_strategy.py b/python/globeop_new_strategy.py new file mode 100644 index 00000000..42ccdee7 --- /dev/null +++ b/python/globeop_new_strategy.py @@ -0,0 +1,63 @@ +from exchangelib import HTMLBody + +from report_ops.utils import Monitor +from report_ops.misc import _cc_recipients + + +_new_strategy_recipients = { + "SERCGMAST": ("serenitas.ops@sscinc.com",), + "BOWDST": ( + "hedgemark.lmcg.ops@sscinc.com", + "pjadhav@sscinc.com", + ), +} + + +class NewStrategyEmail( + Monitor, + headers=( + "portfolio", + "strategy", + ), + num_format=[], +): + @classmethod + def email(cls, fund): + if not cls._staging_queue: + return + cls._em.send_email( + f"New Portfolio/Folder Setup Request {fund}", + HTMLBody( + f""" +<html> + <head> + <style> + table, th, td {{ border: 1px solid black; border-collapse: collapse;}} + th, td {{ padding: 5px; }} + </style> + </head> + <body> + Hello,<br><br>Could you please set up the below portfolio and strategy combinations for this fund: {fund}<br><br>{cls.to_tabulate()} + </body> +</html>""" + ), + to_recipients=("fyu@lmcg.com",), + cc_recipients=_cc_recipients[fund], + ) + + +def email_new_strategy(fund, new_strategies): + for strategy in new_strategies: + NewStrategyEmail.stage(strategy) + NewStrategyEmail.email(fund) + NewStrategyEmail.clear() + + +if __name__ == "__main__": + """Set up new strategy for globeop via email""" + new_strategies = [{"portfolio": "MORTGAGES", "strategy": "IR_HEDGE"}] + for fund in ( + "SERCGMAST", + "BOWDST", + ): + email_new_strategy(fund, new_strategies) |
