-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from codefordayton/sendmail
making the addresses env variables.
- Loading branch information
Showing
1 changed file
with
4 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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), | ||
|