0.2
No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
An adapter for using Mailgun with Rails and Action Mailer
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 3.2.13
~> 2.14.1

Runtime

>= 3.2.13
>= 1.7.7
>= 1.6.7
 Project Readme

mailgun_rails

Build Status

mailgun_rails is an Action Mailer adapter for using Mailgun in Rails apps. It uses the Mailgun HTTP API internally.

Installing

In your Gemfile

gem 'mailgun_rails'

Usage

To configure your Mailgun credentials place the following code in the corresponding environment file (development.rb, production.rb...)

config.action_mailer.delivery_method = :mailgun
config.action_mailer.mailgun_settings = {
		api_key: '<mailgun api key>',
		domain: '<mailgun domain>'
}

Now you can send emails using plain Action Mailer:

email = mail from: 'sender@email.com', to: 'receiver@email.com', subject: 'this is an email'
or 
email = mail from: 'Your Name Here <sender@email.com>', to: 'receiver@email.com', subject: 'this is an email'
email.mailgun_variables = {name_1: :value_1, name_2: value_2}
email.mailgun_recipient_variables = {'user_1@email.com' => {id: 1}, 'user_2@email.com' => {id: 2}}
email.mailgun_headers = {foo: 'bar'}

Mailgun options

To provide option parameters like o:campaign or o:tag.

email.mailgun_options = {campaign: '1'}

Pull requests are welcomed