thoughtbot / griddler-sendgrid

SendGrid adapter for Griddler
MIT License
32 stars 35 forks source link

getting undefined method `split' for nil:NilClass when trying to process a webhook #4

Closed ghost closed 10 years ago

ghost commented 10 years ago

running rails 3.2.14 using griddler (1.0.0) and griddler-sendgrid (0.0.1)

using both the 'test integration' button in the 'Event Notification' app of SendGrid and using the example curl post request:

curl -X POST -H "Content-Type: application/json" -d '[{"email":"john.doe@sendgrid.com","timestamp":1337197600,"smtp-id":"4FB4041F.6080505@sendgrid.com","event":"processed"},{"email":"john.doe@sendgrid.com","timestamp":1337966815,"category":"newuser","event":"click","url":"http://sendgrid.com"},{"email":"john.doe@sendgrid.com","timestamp":1337969592,"smtp-id":"20120525181309.C1A9B40405B3@Example-Mac.local","event":"processed"}]'

getting this error:

undefined method `split' for nil:NilClass

with this backtrace:


- griddler (1.0.0) lib/griddler/email_parser.rb:59:in `extract_email_address'
 - griddler (1.0.0) lib/griddler/email_parser.rb:15:in `parse_address'
 - griddler (1.0.0) lib/griddler/email.rb:43:in `extract_address'
 - griddler (1.0.0) lib/griddler/email.rb:13:in `initialize'
 - griddler (1.0.0) app/controllers/griddler/emails_controller.rb:4:in `block in create'
 - griddler (1.0.0) app/controllers/griddler/emails_controller.rb:3:in `create'
ghost commented 10 years ago

I abandoned this for a while but now looked at it again to realise I was using this gem for the wrong function. My bad, sorry!