Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update dependencies #50

Merged
merged 6 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Specs
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
- run: bundle install
- run: bundle exec rspec
2 changes: 0 additions & 2 deletions .rspec

This file was deleted.

15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

3 changes: 0 additions & 3 deletions Guardfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
# More info at https://github.com/guard/guard#readme

guard :rspec, cmd: "bundle exec rspec", all_on_start: false, all_after_pass: false do

watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }

end

33 changes: 14 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Mandrill::Rails

[![travis](https://secure.travis-ci.org/evendis/mandrill-rails.png)](http://travis-ci.org/evendis/mandrill-rails)

The primary goal of Mandrill::Rails is to make supporting Mandrill web hooks as easy and Rails-native as possible. As other opportunities for better Rails integration of the Mandrill API are discovered, these may be rolled in too.

I thought about implementing this as an engine, but the overhead did not seem appropriate. Maybe that view will change..
Expand All @@ -13,10 +11,11 @@ If you need direct API integration in addition to Mandrill::Rails features, you

FYI, [Mandrill](http://mandrill.com/) is the transactional email service by the same folks who do MailChimp.


## Requirements and Known Limitations

Mandrill::Rails 1.5.0+ only supports Rails 5 and MRI 2.2.2+.
For Rails 7+, use [Action Mailbox](https://guides.rubyonrails.org/v7.1/action_mailbox_basics.html) instead. Mandrill::Rails is no longer being maintained for newer Rails versions.

Mandrill::Rails 1.5.0+ supports Rails 5 and Rails 6.

For Rails >= 3.0.3, use Mandrill::Rails 1.4.1.

Expand All @@ -30,11 +29,11 @@ Add this line to your application's Gemfile:

And then execute:

$ bundle
bundle

Or install it yourself as:

$ gem install mandrill-rails
gem install mandrill-rails

### How do I install it for gem development?

Expand Down Expand Up @@ -90,14 +89,16 @@ You can setup as many of these controllers as you need, if you wish different ty
### How do I configure Mandrill to send inbound email to my app?

See [Mandrill Inbound Domains](https://mandrillapp.com/inbound)

* enter the mail route you want to match on e.g. *@app.mydomain.com
* set the WebHook enpoint to match e.g. http://mydomain.com/inbox
* set the WebHook enpoint to match e.g. <http://mydomain.com/inbox>

### How do I configure Mandrill to send WebHook requests to my app?

See [Mandrill WebHooks](https://mandrillapp.com/settings/webhooks)

* select the events you want to trigger on
* set the "Post to URL" to point to your controller e.g. http://mydomain.com/inbox
* set the "Post to URL" to point to your controller e.g. <http://mydomain.com/inbox>

### How do I handle specific Mandrill event payloads in my app?

Expand Down Expand Up @@ -157,11 +158,10 @@ directive to your controller:
unhandled_events_raise_exceptions!
end


### How can I authenticate Mandrill Webhooks?

Mandrill now supports {webhook authentication}[http://help.mandrill.com/entries/23704122-Authenticating-webhook-requests] which can help prevent unauthorised posting to your webhook handlers. You can lookup and reset your API keys on the
{Mandrill WebHook settings}[https://mandrillapp.com/settings/webhooks] page.
Mandrill now supports [webhook authentication](http://help.mandrill.com/entries/23704122-Authenticating-webhook-requests) which can help prevent unauthorised posting to your webhook handlers. You can lookup and reset your API keys on the
[Mandrill WebHook settings](https://mandrillapp.com/settings/webhooks) page.

If you do not configure your webhook API key, then the handlers will continue to work fine - they just won't be authenticated.

Expand Down Expand Up @@ -221,7 +221,7 @@ some are included in the project source under spec/fixtures/webhook_examples.
In addition to providing full Hash-like access to the raw message, the `event_payload` object
(a Mandrill::WebHook::EventDecorator) provides a range of helper methods for some of the more obvious
things you might need to do with the payload. Here are some examples (see
{Mandrill::WebHook::EventDecorator class documentation}[http://rubydoc.info/gems/mandrill-rails/Mandrill/WebHook/EventDecorator]
[Mandrill::WebHook::EventDecorator class documentation](http://rubydoc.info/gems/mandrill-rails/Mandrill/WebHook/EventDecorator)
for full details)

event_payload.message_id
Expand All @@ -248,7 +248,6 @@ for full details)
# [ email, email, .. ]
# Applicable events: inbound


### How to extend Mandrill::WebHook::EventDecorator for application-specific payload handling?

It's likely you may benefit from adding more application-specific intelligence to the
Expand Down Expand Up @@ -304,7 +303,6 @@ For example:
end
end


### How do I extract images from an inbound email?

The EventDecorator class provides an `images` method to access an array of images (if any).
Expand All @@ -331,16 +329,14 @@ For example:
end
end


### How do I use Mandrill API features with Mandrill::Rails?

Mandrill::Rails currently does not need or require any direct Mandrill API integration (such as provided by
various {Mandrill}[https://rubygems.org/search?utf8=%E2%9C%93&query=mandrill]
and {MailChimp}[https://rubygems.org/search?utf8=%E2%9C%93&query=mailchimp] gems).
various [Mandrill](https://rubygems.org/search?utf8=%E2%9C%93&query=mandrill)
and [MailChimp](https://rubygems.org/search?utf8=%E2%9C%93&query=mailchimp) gems).
If you need direct API integration in addition to Mandrill::Rails features,
you can choose to add whichever best meets your needs and use as normal.


## Contributing to Mandrill::Rails

* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
Expand All @@ -354,4 +350,3 @@ you can choose to add whichever best meets your needs and use as normal.
## Copyright

Copyright (c) 2012 Paul Gallagher. See LICENSE for further details.

1 change: 1 addition & 0 deletions lib/mandrill-rails.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require 'json'
require 'openssl'
require 'logger'
require 'active_support'
require 'active_support/core_ext'

Expand Down
33 changes: 16 additions & 17 deletions mandrill-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,24 @@
require File.expand_path('../lib/mandrill-rails/version', __FILE__)

Gem::Specification.new do |spec|
spec.authors = ["Paul Gallagher"]
spec.email = ["gallagher.paul@gmail.com"]
spec.description = "Rails integration for Mandrill"
spec.summary = "Provides webhook processing and event decoration to make using Mandrill with Rails just that much easier"
spec.homepage = "https://github.com/evendis/mandrill-rails"
spec.name = 'mandrill-rails'
spec.version = Mandrill::Rails::VERSION
spec.authors = ['Paul Gallagher']
spec.email = ['gallagher.paul@gmail.com']
spec.description = 'Rails integration for Mandrill'
spec.summary = 'Provides webhook processing and event decoration to make using Mandrill with Rails just that much easier'
spec.homepage = 'https://github.com/evendis/mandrill-rails'
spec.license = 'MIT'

spec.files = `git ls-files`.split($\)
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.name = "mandrill-rails"
spec.require_paths = ["lib"]
spec.version = Mandrill::Rails::VERSION
spec.files = `git ls-files`.split($/)
spec.executables = spec.files.grep(%r{^bin/}).map { |f| File.basename(f) }
spec.require_paths = ['lib']

spec.add_runtime_dependency "activesupport", ">= 4"
spec.add_runtime_dependency 'activesupport', '>= 4', '< 7.0'

spec.add_development_dependency "bundler", "~> 1.14"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_development_dependency "generator_spec", "~> 0.9"
spec.add_development_dependency "guard-rspec", "~> 4.7"
spec.add_development_dependency 'rake', '>= 12.3.3'
spec.add_development_dependency 'bundler', '>= 2.2.33'
spec.add_development_dependency 'rspec'
spec.add_development_dependency 'generator_spec'
spec.add_development_dependency 'guard-rspec'
end
6 changes: 1 addition & 5 deletions spec/support/fixtures_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
require 'json'

module FixturesHelper

def webhook_examples_path
Pathname.new(File.dirname(__FILE__)).join('..','fixtures','webhook_examples')
end
Expand Down Expand Up @@ -30,11 +29,8 @@ def payload_examples_path
def payload_example(sample_name)
payload_examples_path.join(sample_name).read
end


end


RSpec.configure do |conf|
conf.include FixturesHelper
end
end