Skip to content

Instantly share code, notes, and snippets.

@trusche
Last active September 17, 2025 18:15
Show Gist options
  • Select an option

  • Save trusche/96021f39c72b5be00c83c1d810f8081e to your computer and use it in GitHub Desktop.

Select an option

Save trusche/96021f39c72b5be00c83c1d810f8081e to your computer and use it in GitHub Desktop.
class PostmarkController < ApplicationController
skip_before_action :verify_authenticity_token
http_basic_authenticate_with name: "foo", password: "not our real password, doh."
def create
payload = JSON.parse(request.body.read)
case payload["RecordType"]
when "Bounce"
if user = User.find_by(email: payload["Email"])
user.update(
email_bounced_at: Time.parse(payload["BouncedAt"]),
email_bounce_details: payload["Details"]
)
end
end
ensure
head :ok
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment