https://github.com/maartenvanvliet/receivex
  
  
    Deal with inbound email webhooks 
    https://github.com/maartenvanvliet/receivex
  
        Last synced: 7 months ago 
        JSON representation
    
Deal with inbound email webhooks
- Host: GitHub
- URL: https://github.com/maartenvanvliet/receivex
- Owner: maartenvanvliet
- License: mit
- Created: 2018-12-14T14:58:52.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-03T04:57:26.000Z (over 2 years ago)
- Last Synced: 2025-04-13T12:54:51.638Z (7 months ago)
- Language: Elixir
- Size: 150 KB
- Stars: 20
- Watchers: 2
- Forks: 3
- Open Issues: 7
- 
            Metadata Files:
            - Readme: README.md
- License: LICENSE
 
Awesome Lists containing this project
README
          # Receivex
[](https://travis-ci.com/maartenvanvliet/receivex) [](https://hex.pm/packages/receivex) [](https://hexdocs.pm/receivex) [](https://opensource.org/licenses/MIT)
Package to deal with inbound email webhooks for several providers. Right now 
Mailgun and Mandrill are supported.
## Installation
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `receivex` to your list of dependencies in `mix.exs`:
```elixir
def deps do
  [
    {:receivex, "~> 0.8.2"}
  ]
end
```
Example configuration for Mandrill with the Plug router
```elixir
forward("_incoming", to: Receivex, init_opts: [
  adapter: Receivex.Adapter.Mandrill,
  adapter_opts: [
    secret: "i8PTcm8glMgsfaWf75bS1FQ",
    url: "http://example.com"
  ],
  handler: Example.Processor]
)
```
Example configuration for Mandrill with the Phoenix router
```elixir
forward("_incoming", Receivex, [
  adapter: Receivex.Adapter.Mandrill,
  adapter_opts: [
    secret: "i8PTcm8glMgsfaWf75bS1FQ",
    url: "http://example.com"
  ],
  handler: Example.Processor]
)
```
Example configuration for Mailgun with the Plug router
```elixir
forward("_incoming", to: Receivex, init_opts: [
  adapter: Receivex.Adapter.Mailgun,
  adapter_opts: [
    api_key: "some-key"
  ],
  handler: Example.Processor]
)
```
Example processor
```elixir
  defmodule Example.Processor do
    @behaviour Receivex.Handler
    def process(%Receivex.Email{} = mail) do
      IO.inspect(mail)
    end
  end
```
Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at [https://hexdocs.pm/receivex](https://hexdocs.pm/receivex).