Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add WebHook event models #40

Open
sebastianblesgen opened this issue Jun 28, 2024 · 0 comments
Open

Add WebHook event models #40

sebastianblesgen opened this issue Jun 28, 2024 · 0 comments

Comments

@sebastianblesgen
Copy link

If I try to implement a webhook, I don't find the models for the body of the POST performed by Mailgun.

EventItem can be used but it's just part of the bod. There is also the signature part. Both are wrapped in a model.

This is what I did in Kotlin with Spring Boot (Java is similar)

   @PostMapping("/events")
    fun eventHook(@RequestBody event: Event) {
        val correlationId = event.eventData.message.headers.messageId
        val timestamp = event.signature.timestamp
        // ....
    }

    data class Event(
        val signature: Signature,
        @JsonProperty("event-data")
        val eventData: EventItem
    )

    data class Signature(
        val token: String,
        val timestamp: String,
        val signature: String
    )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant