docs: def _make_attachment(self, attachment, str_encoding=None):
          """Returns EmailMessage.attachments item formatted for sending with Mailjet
  
          Returns mailjet_dict, is_inline_image
          """
          is_inline_image = False
          if isinstance(attachment, MIMEBase):
              name = attachment.get_filename()
              content = attachment.get_payload(decode=True)
              mimetype = attachment.get_content_type()
  
              if attachment.get_content_maintype() == 'image' and attachment['Content-ID'] is not None:
                  is_inline_image = True
                  name = attachment['Content-ID']
          else:
              (name, content, mimetype) = attachment
  
          # Guess missing mimetype from filename, borrowed from
          # django.core.mail.EmailMessage._create_attachment()
          if mimetype is None and name is not None:
              mimetype, _ = mimetypes.guess_type(name)
          if mimetype is None:
              mimetype = DEFAULT_ATTACHMENT_MIME_TYPE
  
          try:
              # noinspection PyUnresolvedReferences
              if isinstance(content, unicode):
                  # Python 2.x unicode string
                  content = content.encode(str_encoding)
          except NameError:
              # Python 3 doesn't differentiate between strings and unicode
              # Convert python3 unicode str to bytes attachment:
              if isinstance(content, str):
                  content = content.encode(str_encoding)
  
          content_b64 = b64encode(content)
  
          mj_attachment = {
              'Content-type': mimetype,
              'Filename': name or '',
              'content': content_b64.decode('ascii'),
          }
          return mj_attachment, is_inline_image