Skip to content
This repository has been archived by the owner on Oct 18, 2020. It is now read-only.

Commit

Permalink
fixed bug when sendhub mailer used in rails2 via script/runner
Browse files Browse the repository at this point in the history
  • Loading branch information
moomerman committed Sep 6, 2010
1 parent b0b8976 commit 6b572ba
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion lib/sendhub/client.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Sendhub
class Client

VERSION = '0.1.7'
VERSION = '0.1.8'

def initialize(config=nil)
config[:host] ||= 'api.sendhub.net'
Expand Down
24 changes: 12 additions & 12 deletions lib/sendhub/rails2.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
module SendhubMethods

def self.included(base)
base.extend(ClassMethods)
end

module ClassMethods
@sendhub_settings = {}
attr_accessor :sendhub_settings
end

def perform_delivery_sendhub(message)
client = Sendhub::Client.new(
:api_key => @@sendhub_settings[:api_key],
:secret_key => @@sendhub_settings[:secret_key]
:api_key => ActionMailer::Base.sendhub_settings[:api_key],
:secret_key => ActionMailer::Base.sendhub_settings[:secret_key]
)
res = client.send_email(
:from => message.from,
Expand All @@ -13,16 +23,6 @@ def perform_delivery_sendhub(message)
)
end

def self.included(base)
base.extend(ClassMethods)
end

module ClassMethods
def sendhub_settings=(options)
@@sendhub_settings = options
end
end

end

class ActionMailer::Base
Expand Down
4 changes: 2 additions & 2 deletions sendhub.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

Gem::Specification.new do |s|
s.name = %q{sendhub}
s.version = "0.1.7"
s.version = "0.1.8"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Richard Taylor"]
s.date = %q{2010-09-04}
s.date = %q{2010-09-06}
s.description = %q{sendhub is a Ruby client library for SendHub.net.}
s.email = %q{[email protected]}
s.files = ["LICENSE", "README.textile","lib/sendhub.rb"] + Dir.glob('lib/sendhub/*.rb')
Expand Down

0 comments on commit 6b572ba

Please sign in to comment.