Emailing application file

Should I be able to email an application file using a http api call to sendgrid?
I’m not sure where in the process I need to Base64 encode it and how?

To explain it further, the application file that I want to email has been added there by a Notebook, so maybe it’s better to use it from the payload right after the notebook finishes ?

@Lars_Andersson,

I want to make sure I understand correctly…

You’re looking to use the HTTP Node to make an HTTP request against the SendGrid API to send an email with an attachment, correct? You are not using either the Email Node or the SendGrid Node?

Thank you,
Heath

Correct.
Unless I can do it easier with the nodes you mentioned, but I didn’t think I could?

@Lars_Andersson,

I’m with you, and you should be able to do this. You will need to base64 encode the attachment before the HTTP node.

You could do this with something like the Mutate Node and the encodeBase64 template helper if you would like for the encoded data to remain on the payload for use in another node.

Otherwise, since the HTTP Node Header Values accept string templates, you can use the encodeBase64 helper right in the header value.

Please let me know if you need more information.

Thank you,
Heath

So if I wanted to use the Header Values in the HTTP Node like {{encodeBase64 val}},
should the “val” just be the URL to the application file?

@Lars_Andersson,

I have not tested this. But the information I have been providing you I have found in the SendGrid API Documentation. They have a great, built-in API tester that may be able to assist you.

Thank you,
Heath