hack princeton

380 views

Published on

1 Comment
0 Likes
Statistics
Notes
  • Free Download : https://www.mediafire.com/?8nz717bo19i6uv7
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

No Downloads
Views
Total views
380
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
4
Comments
1
Likes
0
Embeds 0
No embeds

No notes for slide

hack princeton

  1. 1. Hack Princeton Kunal Batra Developer Evangelist 11/08/13
  2. 2. What is SendGrid ? • Cloud based SMTP email Provider – Transactional: Registration, forgotten passwords, account notifications. • Massively Scalable • Analytics on the emails you send – Unsubscribes, bounces …etc.
  3. 3. Why not build it myself ? • Focus on your core application • Maintaining Email Infrastructure Sucks! – Costly, Time-consuming, Boring!! • 20% of legitimate email goes to spam
  4. 4. Some of our APIs • • • • SMTP API Web API Parse Webhook (Cool!) Event Webhook
  5. 5. Parse API Demo!! Take a photo of some Text && Send an email to: ocrthat@si.ht
  6. 6. Take a Photo
  7. 7. Parse Data from email //Get Post from SendGrid $from = $_POST["from"]; $subject = $_POST["subject"]; //Get Attached Image $fh = fopen('/tmp/parse.log', 'a+'); if ( $fh ) { fwrite($fh, print_r($_POST, true) . print_r($_FILES, true)); foreach ($_FILES as $key => $file) { move_uploaded_file($file['tmp_name'], "upload/".$file['name']); } fclose($fh); }
  8. 8. Convert Photo to text $ocrapi = new Abby($config['abby']['app_id'], $config['abby']['password']); $docName = $ocrapi->convert($file['name']);
  9. 9. Send reply email //Send reply email with attached text document $filePath = dirname(__FILE__).'/upload/'.$docName; $sendgrid = new SendGrid($config['sendgrid']['api_user'], $config['sendgrid']['api_key']); $mail = new SendGridMail(); $mail-> addTo($from)-> setFrom($config['sendgrid']['my_email'])-> setSubject('Re: '.$subject)-> setText($docName)-> setHtml($docName)-> addAttachment($filePath); $sendgrid->smtp->send($mail)
  10. 10. Awesome Prizes- Retro NES/SNES Game Systems
  11. 11. Ouya Gaming Console
  12. 12. Mortal Kombat- 1993
  13. 13. Assorted NES Games
  14. 14. Hack.Sendgrid.com GO TO Hack.Sendgrid.com Sign up for a FREE account && Tweet @kunal732 with your SendGrid username to get setup.

×