mailgun alternatives and similar packages
Based on the "Third Party APIs" category.
Alternatively, view mailgun alternatives based on common mentions on social networks and blogs.
-
MongoosePush
MongoosePush is a simple Elixir RESTful service allowing to send push notification via FCM and/or APNS. -
sparkpost
SparkPost client library for Elixir https://developers.sparkpost.com -
elixtagram
:camera: Instagram API client for the Elixir language (elixir-lang) -
google_sheets
Elixir library for fetching Google Spreadsheet data in CSV format -
pay_pal
:money_with_wings: PayPal REST API client for the Elixir language (elixir-lang) -
amazon_product_advertising_client
An Amazon Product Advertising API client for Elixir -
cashier
Cashier is an Elixir library that aims to be an easy to use payment gateway, whilst offering the fault tolerance and scalability benefits of being built on top of Erlang/OTP -
elixir_ipfs_api
The Elixir library that is used to communicate with the IPFS REST endpoint. -
airbrake
An Elixir notifier to the Airbrake/Errbit. System-wide error reporting enriched with the information from Plug and Phoenix channels.
Learn Elixir in as little as 12 Weeks
Do you think we are missing an alternative of mailgun or a related project?
Popular Comparisons
README
Elixir Mailgun Client 
# config/config.exs
config :my_app, mailgun_domain: "https://api.mailgun.net/v3/mydomain.com",
mailgun_key: "key-##############"
# lib/mailer.ex
defmodule MyApp.Mailer do
@config domain: Application.get_env(:my_app, :mailgun_domain),
key: Application.get_env(:my_app, :mailgun_key)
use Mailgun.Client, @config
@from "[email protected]"
def send_welcome_text_email(user) do
send_email to: user.email,
from: @from,
subject: "hello!",
text: "Welcome!"
end
def send_welcome_html_email(user) do
send_email to: user.email,
from: @from,
subject: "hello!",
html: "<strong>Welcome!</strong>"
end
# attachments expect a list of maps. Each map should have a filename and path/content
def send_greetings(user, file_path) do
send_email to: user.email,
from: @from,
subject: "Happy b'day",
html: "<strong>Cheers!</strong>",
attachments: [%{path: file_path, filename: "greetings.png"}]
end
def send_invoice(user) do
pdf = Invoice.create_for(user) # a string
send_email to: user.email,
from: @from,
subject: "Invoice",
html: "<strong>Your Invoice</strong>",
attachments: [%{content: pdf, filename: "invoice.pdf"}]
end
end
iex> MyApp.Mailer.send_welcome_text_email(user)
{:ok, ...}
Installation
Add mailgun to your mix.exs
dependencies:
def deps do
[ {:mailgun, "~> 0.1.2"} ]
end
Test mode
For testing purposes mailgun can output emails to a local file instead of
actually sending them. Just set the mode
configuration key to :test
and the test_file_path
to where you want that file to appear.
# lib/mailer.ex
defmodule MyApp.Mailer do
@config domain: Application.get_env(:my_app, :mailgun_domain),
key: Application.get_env(:my_app, :mailgun_key),
mode: :test,
test_file_path: "/tmp/mailgun.json"
use Mailgun.Client, @config
...
end
httpc options
Under the hood the client uses httpc
to call Mailgun REST API. You can inject any valid httpc
options to your
outbound requests by defining them within httpc_opts
config entry:
# lib/mailer.ex
defmodule MyApp.Mailer do
@config domain: Application.get_env(:my_app, :mailgun_domain),
key: Application.get_env(:my_app, :mailgun_key),
httpc_opts: [connect_timeout: 2000, timeout: 3000]
use Mailgun.Client, @config
...