agateblue/django-dbes

dbes.backends.EmailBackend appears to drop email attachments

Open

#4 建立於 2018年3月16日

在 GitHub 查看
 (2 留言) (1 反應) (0 負責人)Python (2 fork)github user discovery
enhancementhelp wanted

倉庫指標

Star
 (27 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

I created an email via:

fp = open('sample.csv', 'rb')
email = EmailMessage(
    'Sample email header',
    'Sample email body',
    settings.DEFAULT_FROM_EMAIL,
    [settings.SEND_EMAIL]
)
filename = 'sample.csv'
email.attach(filename, fp.read(), 'text/csv')
email.send()

An email is properly sent, and I'm able to hit the email URL at /emails/:emailId when the dbes email urls are configured as described in the documentation.

When I navigate to the email url, I only see the sample email body, with no indication that an email is attached. I see the attachment printed to the Django console when I use the django.core.mail.backends.console.EmailBackend instead.

It is likely not necessary or feasible to print the contents of the attachment, but displaying the attachments and their filenames somewhere would be useful.

貢獻者指南