Page 1 of 4

SendGrid Mail API, Attachment?

Posted: Mon Apr 08, 2013 5:32 pm
by Hoken

Hi, I' new to Tiggzi and is now struggling with my first app! I want to take a picture with the mobile camera and then e-mail it as an attachment.

I'm using the SendGrid Mail API plugin and got the camera stuff working. I can also send emails from the phone.
Now, I want to attach the picture... I have the picture in a mobilepicture container and also the local path to the file. I've tried to add a "files[file1.jpg]" request parameter and filled it with the path to the file (with a mapping).
When I receive the email there is an attachment icon but without the picture data...
Any ideas?

http://sendgrid.com/docs/API_Referenc...


SendGrid Mail API, Attachment?

Posted: Mon Apr 08, 2013 5:44 pm
by Kateryna Grynko

Hello,

We'll test this.


SendGrid Mail API, Attachment?

Posted: Mon Apr 08, 2013 6:11 pm
by Hoken

Thanx!


SendGrid Mail API, Attachment?

Posted: Mon Apr 08, 2013 8:16 pm
by Kateryna Grynko

Hi,

To add an attachment to mail, parameter files[file1.jpg] should contain binary data of the file. Unfortunately, you can't do it with Tiggzi due to JavaScript restrictions.


SendGrid Mail API, Attachment?

Posted: Mon Apr 08, 2013 9:48 pm
by Hoken

Hmmm... What is the proper way of getting images out of the phone then!? Is there another way?


SendGrid Mail API, Attachment?

Posted: Mon Apr 08, 2013 10:50 pm
by Illya Stepanov

We will try to find it. On what device are you trying to do this?


SendGrid Mail API, Attachment?

Posted: Mon Apr 08, 2013 11:23 pm
by Illya Stepanov

Even though sending binary data is not yet possible via Tiggzi defined service, you can send binary data if you write the service request in JavaScript.


SendGrid Mail API, Attachment?

Posted: Tue Apr 09, 2013 4:28 pm
by Hoken

OK, That sounds good! I will give it a try.


SendGrid Mail API, Attachment?

Posted: Tue Apr 09, 2013 5:07 pm
by Hoken

Is there an example somewere that I can use as a starting point?
Thank you.


SendGrid Mail API, Attachment?

Posted: Tue Apr 09, 2013 6:38 pm
by Kateryna Grynko

Hi,

I would recommend you these references:

Work with Rest Services via JavaScript - https://developer.mozilla.org/en-US/d...
Sending binary data via JavaScript - https://developer.mozilla.org/en-US/d...
New Tricks in XMLHttpRequest2 - http://www.html5rocks.com/en/tutorial...