lib/mailkick/service/mandrill.rb in mailkick-0.1.4 vs lib/mailkick/service/mandrill.rb in mailkick-0.1.5
- old
+ new
@@ -8,13 +8,16 @@
"soft-bounce" => "bounce",
"spam" => "spam",
"unsub" => "unsubscribe"
}
+ # TODO remove ENV["MANDRILL_APIKEY"]
def initialize(options = {})
require "mandrill"
- @mandrill = ::Mandrill::API.new(options[:api_key] || ENV["MANDRILL_APIKEY"])
+ @mandrill = ::Mandrill::API.new(
+ options[:api_key] || ENV["MANDRILL_APIKEY"] || ENV["MANDRILL_API_KEY"]
+ )
end
# TODO paginate
def opt_outs
@mandrill.rejects.list.map do |record|
@@ -24,11 +27,12 @@
reason: REASONS_MAP[record["reason"]]
}
end
end
+ # TODO remove ENV["MANDRILL_APIKEY"]
def self.discoverable?
- !!(defined?(::Mandrill::API) && ENV["MANDRILL_APIKEY"])
+ !!(defined?(::Mandrill::API) && (ENV["MANDRILL_APIKEY"] || ENV["MANDRILL_API_KEY"]))
end
end
end
end