Page 2 of 4

SendGrid Mail API, Attachment?

Posted: Tue Apr 09, 2013 7:05 pm
by Hoken

Thank you!


SendGrid Mail API, Attachment?

Posted: Sat Apr 20, 2013 1:19 pm
by Hoken

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

Thank you.


SendGrid Mail API, Attachment?

Posted: Sat Apr 20, 2013 2:36 pm
by Alena Prykhodko

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...


SendGrid Mail API, Attachment?

Posted: Sat Apr 20, 2013 2:59 pm
by Alena Prykhodko

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...


SendGrid Mail API, Attachment?

Posted: Thu Jul 25, 2013 7:41 am
by Ryein Goddard

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?


SendGrid Mail API, Attachment?

Posted: Thu Jul 25, 2013 8:11 pm
by Ryein Goddard

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


SendGrid Mail API, Attachment?

Posted: Thu Jul 25, 2013 8:15 pm
by Maryna Brodina

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


SendGrid Mail API, Attachment?

Posted: Thu Jul 25, 2013 11:58 pm
by Hoken

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


SendGrid Mail API, Attachment?

Posted: Fri Jul 26, 2013 1:15 pm
by Kateryna Grynko

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


SendGrid Mail API, Attachment?

Posted: Fri Jul 26, 2013 10:33 pm
by Ryein Goddard

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

Thanks.