-
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.
- Loading branch information
1 parent
0da5ebf
commit 28f8bee
Showing
1 changed file
with
6 additions
and
1 deletion.
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 |
---|---|---|
@@ -1,14 +1,19 @@ | ||
import os | ||
import mailtrap as mt | ||
from jinja2 import Template | ||
|
||
def main(args): | ||
MAILTRAP_API_TOKEN = os.environ.get("MAILTRAP_API_TOKEN") | ||
|
||
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]")], | ||
subject="New submission from the DHRN Screener", | ||
text="Congrats for sending test email with Mailtrap!", | ||
text="Please enable HTML to view this message", | ||
html=template.render(data=args), | ||
category="Integration Test", | ||
) | ||
client = mt.MailtrapClient(token=MAILTRAP_API_TOKEN) | ||
|