SlideShare a Scribd company logo
1 of 14
Hack Princeton
Kunal Batra
Developer Evangelist
11/08/13
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.
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
Some of our APIs
•
•
•
•

SMTP API
Web API
Parse Webhook (Cool!)
Event Webhook
Parse API Demo!!
Take a photo of some Text
&&

Send an email to:

ocrthat@si.ht
Take a Photo
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);
}
Convert Photo to text
$ocrapi = new Abby($config['abby']['app_id'], $config['abby']['password']);
$docName = $ocrapi->convert($file['name']);
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)
Awesome Prizes- Retro
NES/SNES Game Systems
Ouya Gaming Console
Mortal Kombat- 1993
Assorted NES Games
Hack.Sendgrid.com

GO TO
Hack.Sendgrid.com
Sign up for a FREE account
&&
Tweet @kunal732 with your
SendGrid username to get
setup.

More Related Content

Similar to hack princeton

Fast and Easy Website Tuneups
Fast and Easy Website TuneupsFast and Easy Website Tuneups
Fast and Easy Website Tuneups
Jeff Wisniewski
 
SPSRED - BCS, REST ans Subscriptions
SPSRED - BCS, REST ans SubscriptionsSPSRED - BCS, REST ans Subscriptions
SPSRED - BCS, REST ans Subscriptions
Chris Givens
 

Similar to hack princeton (20)

LAPHP/LAMPSig Talk: Intro to SendGrid - Building a Scalable Email Infrastructure
LAPHP/LAMPSig Talk: Intro to SendGrid - Building a Scalable Email InfrastructureLAPHP/LAMPSig Talk: Intro to SendGrid - Building a Scalable Email Infrastructure
LAPHP/LAMPSig Talk: Intro to SendGrid - Building a Scalable Email Infrastructure
 
Phishing Intelligence Engine - BlueHat v17
Phishing Intelligence Engine - BlueHat v17Phishing Intelligence Engine - BlueHat v17
Phishing Intelligence Engine - BlueHat v17
 
Client side and server side scripting
Client side and server side scriptingClient side and server side scripting
Client side and server side scripting
 
EAC-VB2023.pdf
EAC-VB2023.pdfEAC-VB2023.pdf
EAC-VB2023.pdf
 
Datasploit - An Open Source Intelligence Tool
Datasploit - An Open Source Intelligence ToolDatasploit - An Open Source Intelligence Tool
Datasploit - An Open Source Intelligence Tool
 
Email_Account_Compromise_VB_2023_Final 2.pdf
Email_Account_Compromise_VB_2023_Final 2.pdfEmail_Account_Compromise_VB_2023_Final 2.pdf
Email_Account_Compromise_VB_2023_Final 2.pdf
 
Don't Get Phished!
Don't Get Phished!Don't Get Phished!
Don't Get Phished!
 
Fast and Easy Website Tuneups
Fast and Easy Website TuneupsFast and Easy Website Tuneups
Fast and Easy Website Tuneups
 
Get and post,session and cookie
Get and post,session and cookieGet and post,session and cookie
Get and post,session and cookie
 
SendGrid New Features 2016
SendGrid New Features 2016SendGrid New Features 2016
SendGrid New Features 2016
 
Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...
Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...
Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...
 
Power to the People: Manipulating SharePoint with Client-Side JavaScript
Power to the People:  Manipulating SharePoint with Client-Side JavaScriptPower to the People:  Manipulating SharePoint with Client-Side JavaScript
Power to the People: Manipulating SharePoint with Client-Side JavaScript
 
SPSRED - BCS, REST ans Subscriptions
SPSRED - BCS, REST ans SubscriptionsSPSRED - BCS, REST ans Subscriptions
SPSRED - BCS, REST ans Subscriptions
 
NZYP Project Casestudy using SilverStripe CMS
NZYP Project Casestudy using SilverStripe CMSNZYP Project Casestudy using SilverStripe CMS
NZYP Project Casestudy using SilverStripe CMS
 
null Bangalore meet - Php Security
null Bangalore meet - Php Securitynull Bangalore meet - Php Security
null Bangalore meet - Php Security
 
Owasp Top 10 A1: Injection
Owasp Top 10 A1: InjectionOwasp Top 10 A1: Injection
Owasp Top 10 A1: Injection
 
PHP記帳網頁教材(第一頁是空白的)
PHP記帳網頁教材(第一頁是空白的)PHP記帳網頁教材(第一頁是空白的)
PHP記帳網頁教材(第一頁是空白的)
 
Amazon Machine Learning Workshop (實作工作坊)
Amazon Machine Learning Workshop (實作工作坊)Amazon Machine Learning Workshop (實作工作坊)
Amazon Machine Learning Workshop (實作工作坊)
 
Modern Web Technologies — Jerusalem Web Professionals, January 2011
Modern Web Technologies — Jerusalem Web Professionals, January 2011Modern Web Technologies — Jerusalem Web Professionals, January 2011
Modern Web Technologies — Jerusalem Web Professionals, January 2011
 
DataSploit - BlackHat Asia 2017
DataSploit - BlackHat Asia 2017 DataSploit - BlackHat Asia 2017
DataSploit - BlackHat Asia 2017
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

hack princeton

  • 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. 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. Some of our APIs • • • • SMTP API Web API Parse Webhook (Cool!) Event Webhook
  • 5. Parse API Demo!! Take a photo of some Text && Send an email to: ocrthat@si.ht
  • 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. Convert Photo to text $ocrapi = new Abby($config['abby']['app_id'], $config['abby']['password']); $docName = $ocrapi->convert($file['name']);
  • 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)
  • 14. Hack.Sendgrid.com GO TO Hack.Sendgrid.com Sign up for a FREE account && Tweet @kunal732 with your SendGrid username to get setup.