diff options
| -rw-r--r-- | python/bondallocation_email.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/python/bondallocation_email.py b/python/bondallocation_email.py index febfa103..d1e42968 100644 --- a/python/bondallocation_email.py +++ b/python/bondallocation_email.py @@ -21,7 +21,7 @@ if __name__ == "__main__": } df = pd.read_sql_query( - "SELECT bonds.id as tradeid, trade_date, settle_date, CASE WHEN buysell THEN 'Buy' ELSE 'Sell' end as buysell, identifier, description , faceamount AS notional, price, accrued, principal_payment + accrued_payment as net_amount, name as counterparty, allocation_contacts FROM bonds LEFT JOIN counterparties on cp_code=code where id=2014 and trade_date = %s", + "SELECT bonds.id as tradeid, trade_date, settle_date, CASE WHEN buysell THEN 'Buy' ELSE 'Sell' end as buysell, identifier, description , faceamount AS notional, price, accrued, principal_payment + accrued_payment as net_amount, name as counterparty, allocation_contacts FROM bonds LEFT JOIN counterparties on cp_code=code WHERE trade_date = %s and not EMAILED and allocated;", con=dawndb, params=(args.trade_date,), ) @@ -56,8 +56,10 @@ if __name__ == "__main__": ) em.send_email( subject=subject, - # to_recipients=row.allocation_contacts if row.allocation_contacts else ('fyu@lmcg.com,'), - to_recipients=("fyu@lmcg.com",), + to_recipients=row.allocation_contacts + if row.allocation_contacts + else ("fyu@lmcg.com,"), + # to_recipients=("fyu@lmcg.com",), cc_recipients=cc_recipients, body=HTMLBody(body), attach=[ |
