AAfghahi commented on code in PR #19929:
URL: https://github.com/apache/superset/pull/19929#discussion_r865426800
##########
superset/utils/core.py:
##########
@@ -928,9 +928,12 @@ def send_email_smtp( # pylint:
disable=invalid-name,too-many-arguments,too-many
# Attach any inline images, which may be required for display in
# HTML content (inline)
for msgid, imgdata in (images or {}).items():
- image = MIMEImage(imgdata)
+ formatted_time = formatdate(localtime=True)
+ file_name = f"{subject} {formatted_time}"
+ image = MIMEImage(imgdata, name=file_name)
image.add_header("Content-ID", "<%s>" % msgid)
image.add_header("Content-Disposition", "inline")
+ image.add_header("Content-Disposition", 'attachment; filename="%s"' %
file_name)
Review Comment:
good question, I am running it now without the file in image to see. The
documentation used both so I emulated and then wasn't able to properly test
until just recently.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]