diff options
Diffstat (limited to 'python/bowdst.py')
| -rw-r--r-- | python/bowdst.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/python/bowdst.py b/python/bowdst.py index b897221e..0af626e5 100644 --- a/python/bowdst.py +++ b/python/bowdst.py @@ -78,23 +78,23 @@ def send_email( df_cds: pd.DataFrame, df_tranches: pd.DataFrame, ): - email = Message( - account=em._account, - folder=em._account.sent, - subject=f"{workdate} positions", - body="", - to_recipients=("reconfiles@bnymellon.com", "hm-operations@bnymellon.com"), - cc_recipients=("bowdoin-ops@lmcg.com",), - ) + attachments = [] for name, df in zip(("bonds", "cds", "tranches"), (df_bonds, df_cds, df_tranches)): buf = StringIO() df.to_csv(buf) - attachment = FileAttachment( - name=f"{workdate} {name}.csv", content=buf.getvalue().encode() + attachments.append( + FileAttachment( + name=f"{workdate} {name}.csv", content=buf.getvalue().encode() + ) ) buf.close() - email.attach(attachment) - email.send_and_save() + em.send_email( + f"{workdate} positions", + "", + to_recipients=("reconfiles@bnymellon.com", "hm-operations@bnymellon.com"), + cc_recipients=("bowdoin-ops@lmcg.com",), + attachments=attachments, + ) if __name__ == "__main__": |
