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"""
Hello,
Could you please set up the below portfolio and strategy combinations for this fund: {fund}
{cls.to_tabulate()}
"""
),
to_recipients=_new_strategy_recipients[fund],
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)