Email a CSV Attachment with SendGrid

Hello, I'm using sengrid_basic_send from the Marketplace. I have it working as expected where it sends to an email with a body and subject, but I am having trouble attaching a CSV generated from one of my tables.

The first screenshot is an example of my final attachment_data which is used in my second screenshot showing the function stack.

This current setup is causing an error from the sengrid_basic_send function:

"Whoops! An error occurred. Exception: The attachment content is required."

In line 10 when the attachment data is created, it does not have the attachment type or the content . I add these manually in lines 11 and 12 to "text/csv" and csv_64encoded

However - I'm still getting an error from Sendgrid that the attachment content seems missing?

Any help would be appreciated - Note: the sendgrid_basic_send function takes in an attachment and when it actually makes the request, it adds it to a list of attachments, as the API expects. ( attachment -> "attachments": [attachment])