Mailgun: add AMPHTML support

This commit is contained in:
medmunds
2021-01-26 18:08:39 -08:00
committed by Mike Edmunds
parent d33c9ea4ed
commit d1ef61d3ba
4 changed files with 30 additions and 0 deletions

View File

@@ -310,6 +310,14 @@ class MailgunPayload(RequestsPayload):
self.unsupported_feature("multiple html parts")
self.data["html"] = body
def add_alternative(self, content, mimetype):
if mimetype.lower() == "text/x-amp-html":
if "amp-html" in self.data:
self.unsupported_feature("multiple html parts")
self.data["amp-html"] = content
else:
super().add_alternative(content, mimetype)
def add_attachment(self, attachment):
# http://docs.python-requests.org/en/v2.4.3/user/advanced/#post-multiple-multipart-encoded-files
if attachment.inline: