Skip to content

Commit

Permalink
At the moment, using the EmailTemplate() doesn't allow Metadata param…
Browse files Browse the repository at this point in the history
…eters.

EmailTemplate() now accept Metadata parameters.

e.g.
```
postmark.emails.EmailTemplate(
	TemplateId=template_id,
	TemplateAlias=template_alias,
	From=f"{from_name} {from_}",
	To=user.email,
	Headers={"X-Accept-Language": "en-us, en"},
	TemplateModel=template_model,
	Metadata=metadata
)
```
  • Loading branch information
cmabastar authored and Stranger6667 committed Mar 31, 2020
1 parent 167142b commit b3efc2f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions postmarker/models/emails.py
Expand Up @@ -380,6 +380,7 @@ def send_with_template(
TrackLinks="None",
Attachments=None,
InlineCss=True,
Metadata=None,
):
return self.EmailTemplate(
TemplateId=TemplateId,
Expand All @@ -397,6 +398,7 @@ def send_with_template(
TrackLinks=TrackLinks,
Attachments=Attachments,
InlineCss=InlineCss,
Metadata=Metadata
).send()

def send_batch(self, *emails, **extra):
Expand Down Expand Up @@ -467,6 +469,7 @@ def EmailTemplate(
TrackLinks="None",
Attachments=None,
InlineCss=True,
Metadata=None,
):
"""
Constructs :py:class:`EmailTemplate` instance.
Expand All @@ -490,6 +493,7 @@ def EmailTemplate(
TrackLinks=TrackLinks,
Attachments=Attachments,
InlineCss=InlineCss,
Metadata=Metadata,
)

def EmailBatch(self, *emails):
Expand Down

0 comments on commit b3efc2f

Please sign in to comment.