Class: PostmarkBounce::WebhookController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/postmark_bounce/webhook_controller.rb

Instance Method Summary collapse

Instance Method Details

#eventObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/controllers/postmark_bounce/webhook_controller.rb', line 6

def event
  eb = PostmarkBounce::Email.create(
    bounce_id: params["ID"],
    kind: params["Type"],
    name: params["Name"],
    message_id: params["MessageID"],
    description: params["Description"],
    details: params["Details"],
    email: params["Email"],
    bounced_at: params["BouncedAt"],
    subject: params["Subject"]
  )
  if eb
    render body: "success", status: 200
  else
    render body: "error no email", status: 404
  end
end