FIX: use metadata to hold the message_id with sparkpost

This commit is contained in:
Régis Hanol
2016-10-27 19:35:50 +02:00
parent 407cda1dfe
commit 71f940d478
3 changed files with 7 additions and 3 deletions

View File

@ -91,7 +91,7 @@ class WebhooksController < ActionController::Base
def sparkpost
events = params["_json"] || [params]
events.each do |event|
message_id = event["msys"]["message_event"]["message_id"] rescue nil
message_id = event["msys"]["message_event"]["rcpt_meta"]["message_id"] rescue nil
bounce_class = event["msys"]["message_event"]["bounce_class"] rescue nil
next unless message_id && bounce_class