diff options
-rw-r--r-- | yaksh/send_emails.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/yaksh/send_emails.py b/yaksh/send_emails.py index e54e0a7..061cb0e 100644 --- a/yaksh/send_emails.py +++ b/yaksh/send_emails.py @@ -70,9 +70,10 @@ def send_bulk_mail(subject, email_body, recipients, attachments): msg.attach_alternative(email_body, "text/html") if attachments: for file in attachments: - path = default_storage.save('attachments/'+file.name, - ContentFile(file.read()) - ) + path = default_storage.save( + os.path.join('attachments', file.name), + ContentFile(file.read()) + ) msg.attach_file(os.sep.join((settings.MEDIA_ROOT, path)), mimetype="text/html" ) |