Open itssimon opened 3 weeks ago
thanks for reporting @itssimon, sure thing, ill double check that.
@drish any updates ?
I'm facing the same issue, and the error info doesn't really help:
Expecting value: line 1 column 1 (char 0)
It's quite critical for our business to be able to send order confirmations, and so far we've been comfortably relying on Resend for that - please help ASAP :))
I pass html as an f string
to the html
entry of the sendParams
, like this:
send_params = {
'from': 'Company <mail@company.com>',
'to': ['mail@user.com'],
'subject': f'Your order is confirmed #{order_number}',
'html': generate_order_confirmation_html(...),
}
def generate_order_confirmation_html(arg):
return f'''
<center style="width: 100%; table-layout: fixed; background-color: #F5F0E6; padding: 20px 0 100px">
<p>{arg}</p>
</center>
'''
Args are always of type str
and sometimes I embed a base64
encoded QR code in an img element, however, the JSONDecodeError occurs with and without any base64
embeddings.
Resend version 2.1.0
@gustavjohansen98 thanks for sending over your issue as well, a new version should be going out soon (today/tomorrow), that handles unexpected responses from the API more gracefully.
I shared the issue with the rest of the engineering team to investigate why sometimes the API does not return a valid response.
I've been getting a few 503 responses from the Resend API when calling
resend.Emails.send()
recently, with the response body being HTML. This library tries to parse that as JSON and raises aJSONDecodeError
. Would be nice if that could be handled more gracefully.The response body that causes this error looks like this: