Skip to content

Commit

Permalink
making the addresses env variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidEBest committed May 21, 2024
1 parent 3574af3 commit b2883ef
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dhrn-functions/packages/dhrn/sendmail/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@

def main(args):
MAILTRAP_API_TOKEN = os.environ.get("MAILTRAP_API_TOKEN")
MAILTRAP_SENDER_ADDRESS = os.environ.get("MAILTRAP_SENDER_ADDRESS")
MAILTRAP_TO_ADDRESS = os.environ.get("MAILTRAP_TO_ADDRESS")

with open("template.html") as f:
template = Template(f.read())

mail = mt.Mail(
sender=mt.Address(email="[email protected]", name="Mailtrap Test"),
to=[mt.Address(email="[email protected]")],
sender=mt.Address(email=MAILTRAP_SENDER_ADDRESS, name="Code For Dayton"),
to=[mt.Address(email=MAILTRAP_TO_ADDRESS)],
subject="New submission from the DHRN Screener",
text="Please enable HTML to view this message",
html=template.render(data=args),
Expand Down

0 comments on commit b2883ef

Please sign in to comment.