Hoken
Posts: 0
Joined: Mon Apr 08, 2013 5:32 pm

SendGrid Mail API, Attachment?

Thank you!

Hoken
Posts: 0
Joined: Mon Apr 08, 2013 5:32 pm

SendGrid Mail API, Attachment?

Has anyone done this before? How do I convert the image to Binary data?

Thank you.

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

SendGrid Mail API, Attachment?

Hello Hoken!

Did you mean was it done before in Appery.io?
You can try to export it as Eclipse project and continue to work there.
This reference could be also useful:
http://stackoverflow.com/questions/49...

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

SendGrid Mail API, Attachment?

Sending binary data could be done when you're building an app in Appery.io.
You have to code it yourself.
Following reference could be helpful: http://docs.appery.io/tutorials/uploa...

Ryein Goddard
Posts: 0
Joined: Fri Jul 19, 2013 3:09 am

SendGrid Mail API, Attachment?

So basically if I understand this correctly to get this working in the manner Hoken and I would like you need to convert the image to binary?

I don't actually save the image locally so I have a base64 encoding. If I was to convert this to binary and send that it should work?

Ryein Goddard
Posts: 0
Joined: Fri Jul 19, 2013 3:09 am

SendGrid Mail API, Attachment?

I've basically given up on using SendGrid. What a waste of time.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

SendGrid Mail API, Attachment?

We're working on your request. I'll update.

Hoken
Posts: 0
Joined: Mon Apr 08, 2013 5:32 pm

SendGrid Mail API, Attachment?

I gave up to... ;) Really, this should be available "out of the box"!

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

SendGrid Mail API, Attachment?

Hi,

This function returns an object you can pass as data of image loading AJAX-call:
codefunction dataURItoBlob(dataURI) {
var byteString = atob(dataURI.split(',')[1]);
var ab = new ArrayBuffer(byteString.length);
var ia = new Uint8Array(ab);
for (var i = 0; i < byteString&#46;length; i++) {
ia = byteString&#46;charCodeAt(i);
}
return new Blob([ab], {
type: 'image&#47;jpeg'
});
}/code

Ryein Goddard
Posts: 0
Joined: Fri Jul 19, 2013 3:09 am

SendGrid Mail API, Attachment?

This is good, but why can't i just send the base64 encoding? SendGrid already said they support that.

Thanks.

Return to “Issues”