Fix sendgrid attachment sending error#119
Merged
Merged
Conversation
Stacktrace:
```
File "/app/opwen_email_server/actions.py", line 32, in __call__
return self._action(*args, **kwargs)
File "/app/opwen_email_server/actions.py", line 59, in _action
success = self._send_email(email)
File "/app/opwen_email_server/services/sendgrid.py", line 43, in __call__
return self._send_email(email, email_id)
File "/app/opwen_email_server/services/sendgrid.py", line 49, in _send_email
status = self._client(request)
File "/app/opwen_email_server/services/sendgrid.py", line 35, in send_email
response = client.client.mail.send.post(request_body=email)
File "/venv/lib/python3.6/site-packages/python_http_client/client.py", line 236, in http_request
kwargs['request_body']).encode('utf-8')
File "/usr/local/lib/python3.6/json/__init__.py", line 231, in dumps
return _default_encoder.encode(obj)
File "/usr/local/lib/python3.6/json/encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/local/lib/python3.6/json/encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "/usr/local/lib/python3.6/json/encoder.py", line 180, in default
o.__class__.__name__)
TypeError: Object of type 'bytes' is not JSON serializable
```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacktrace: