views:

33

answers:

2

Hey all!

ive got a email setup to forward to mx.sendgrid.new (the sendgrid mail server) then with received emails sendgrid passes them to a specified page (as shown in the 2nd image of the tutorial im following)

http://nanceskitchen.com/2010/02/21/accept-incoming-emails-into-a-heroku-app-using-sendgrid/#comment-37

SO what CODE is inside that index file that passes the sendgrid email into the controller

is it just like a regular form page...?

A: 

There should be no index file (as in a static HTML or view file) involved.

Sendgrid makes the request to your app on a given URL. From your app's side, this request is handled straight by the controller. But instead of the params hash being populated by form data, it's populated by the data in the request from Sendgrid.

tfe
Ok so i think i've determined that i need a MODEL for this...
delinquentme
If you want to persist the information to a database, then yes.
tfe
A: 

There is no index file, just a post request to your application made from SendGrid. You specify the url you want that post to go to, and when SendGrid receives an email, it posts a request to your specified URL, with the email fields as parameters.

PS. NancesKitchen.com is my blog.

DougB
Ok so i think i've determined that i need a MODEL for this... currently its completely empty :D http://pastie.org/1206650 so what goes in the ? ... what am i inheriting here to make this work w sendgrid?
delinquentme
dougB is there any way i could pick your brain on this for like 10 minutes on aim or something :D .. i think im mildly lost even on the basics .. like i guess the order is a good spot to start: ... 1) email gets sent 2) email hits addy and gets forwarded to the mx.sendgrid.net 3) sendgrid passes the email to the app 4)app accepts via controller 5) controller writes it to the database .. so like where dos the model come in and what lines write stuff to the database :D
delinquentme
dougB simple question ... do you have a corresponding model file for this app?
delinquentme