This topic was automatically generated from Slack. You can find the original thread here.
I’m running into an issue trying provide an attachment in a Sendgrid block (Send to Single Recipient). To put the data in the right format I have a Python code block before the Sendgrid block that looks like:
def handler(pd: "pipedream"):
Attachement = [{"content":"<somebase64data>", "type":"application/pdf","filename":"somefilename.pdf"}]
return {"Attachment": {"data": Attachement}}
This works for small files, but for larger base64 strings that aren’t actually that large (e.g. 200kb) in terms of file-size attachments, the module throws the error
"Mysql2::Error: Data too long for column 'code' at row 1"
Do you know of any workarounds?
I also haven’t been able to figure out how to feed the appropriate string directly into the Attachments field for the SendGrid Send to Single Recipient block. If I just directly write in [{content:"aGV5",type:"text/plain",filename:"sample.txt"}]
as documented beneath the field, the block throws the error Expected property name or '}' in JSON at position 1