Skip to content

maartenvanvliet/receivex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Receivex

Build Status Hex pm Hex Docs License

Package to deal with inbound email webhooks for several providers. Right now Mailgun and Mandrill are supported.

Installation

If available in Hex, the package can be installed by adding receivex to your list of dependencies in mix.exs:

def deps do
  [
    {:receivex, "~> 0.8.2"}
  ]
end

Example configuration for Mandrill with the Plug router

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

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

forward("_incoming", to: Receivex, init_opts: [
  adapter: Receivex.Adapter.Mailgun,
  adapter_opts: [
    api_key: "some-key"
  ],
  handler: Example.Processor]
)

Example processor

  defmodule Example.Processor do
    @behaviour Receivex.Handler

    def process(%Receivex.Email{} = mail) do
      IO.inspect(mail)
    end
  end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/receivex.

About

Deal with inbound email webhooks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages