Skip to content

Commit

Permalink
Support Standard Webhooks.
Browse files Browse the repository at this point in the history
  • Loading branch information
cpursley committed Dec 27, 2023
1 parent 4b27925 commit 87337c3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ Webhoox makes it easy to deal with inbound webhooks by using an adapter-based ap

This library started off as a fork of Maarten's awesome [receivex](https://github.com/maartenvanvliet/receivex) email-focused library.

Webhoox aims to support the [Standard Webhooks](https://www.standardwebhooks.com/) spec and includes an [authentication module](./lib/webhoox/authentication/standard_webhook.ex) and [adapter](./lib/webhoox/adapters/standard_webhook.ex)

## Adapters

- [Standard Webhook](./lib/webhoox/adapters/standard_webhook.ex)
- [MailerSend](./lib/webhoox/adapters/mailersend.ex)
- [Mailgun](./lib/webhoox/adapters/mailgun.ex)
- [Mandrill](./lib/webhoox/adapters/mandrill.ex)
Expand All @@ -23,23 +26,20 @@ by adding `webhoox` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:webhoox, "~> 0.2.0"}
{:webhoox, "~> 0.3.0"}
]
end
```

## Configuration

Example configuration for Mandrill with the Plug router:
Example configuration for Standard Webhook with the Plug router:

```elixir
# Your router.ex file
forward("_incoming", to: Webhoox, init_opts: [
adapter: Webhoox.Adapter.Mandrill,
adapter_opts: [
secret: "i8PTcm8glMgsfaWf75bS1FQ",
url: "http://example.com"
],
adapter: Webhoox.Adapter.StandardWebhook,
adapter_opts: [secret: "MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw"],
handler: Example.Processor]
)
```
Expand All @@ -50,7 +50,7 @@ Example Processor:
defmodule Example.Processor do
@behaviour Webhoox.Handler

def process(%Webhoox.Webhook.Email{} = email) do
def process(webhook = %Webhoox.Webhook.StandardWebhook{}) do
# You probably want to handle processing of the event asynchronously
# and go ahead and return a 200 as not to block the sending server

Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Webhoox.MixProject do
use Mix.Project

@version "0.2.0"
@version "0.3.0"

def project do
[
Expand Down

0 comments on commit 87337c3

Please sign in to comment.