Mailman::Rails
This gem helps you integrate ruby Mailman with Rails. It adds rake tasks to manage a mailman daemon and allows you to configure a Mailman::Application instance from within your models.
Installation
Add this line to your application's Gemfile:
gem 'mailman-rails'
And one of these lines depending on status of pull requests, versions etc:
gem 'mailman', :git => 'https://github.com/johncant/mailman'
gem 'mailman', :git => 'https://github.com/titanous/mailman'
gem 'mailman'
And then execute:
$ bundle
Or install it yourself as:
$ gem install mailman-rails
Usage
Put your Mailman config in config/initializers/mailman.rb
Match Mailman stuff from your models:
class Post < ActiveRecord::Base # Or whatever
Mailman::Rails.receive do
to "[email protected]" do
Post.create(JSON.parse(.body))
end
end
# The daemon would be started from the rake task but only after all the code is loaded.
end
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request