title: Object of type bytes is not JSON serializable when trying to send a file from S3 as an email attachment
body: <p>Error message:</p>
  <blockquote>
  <p>&quot;errorMessage&quot;: &quot;Object of type bytes is not JSON serializable&quot;</p>
  </blockquote>
  <pre><code>def _get_file():
      s3 = boto3.resource('s3')
      obj = s3.Object(S3_BUCKET_NAME, S3_ITEM_NAME)
      return obj.get()['Body'].read()
  
  def _send_email_with_ebook(email):
      data = {
          ...
          &quot;attachments&quot;: [
              {
                  &quot;content&quot;: _get_ebook_file(),
                  &quot;type&quot;: &quot;application/pdf&quot;,
                  &quot;filename&quot;: &quot;my_file.pdf&quot;
              }
          ]
      }
  
      headers = {'Authorization': 'Bearer {}'.format(SENDGRID_API_KEY), 'Content-Type': 'application/json'}
      r = requests.post(SENDGRID_API_URL, json=data, headers=headers)
  </code></pre>