django-mailviews
django-mailviews copied to clipboard
Support downloading rendered `multipart/alternative` content.
Allowing easy download of the rendered preview message (using Content-Disposition: attachment; filename="preview.eml"
) would make it easier to open up the message in an email client (rather than the browser) for a more representative preview.
I've confirmed that this this works on OS X Mail.app, at least — this would work with an intermediate store for the rendered content:
response = HttpResponse(str(message.message()), content_type='multipart/mixed')
response['Content-Disposition'] = 'attachment; filename="preview.eml"'
return response
I'm not sure where that intermediate store would be — in-memory cache?