Last active
September 17, 2025 18:15
-
-
Save trusche/96021f39c72b5be00c83c1d810f8081e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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