sendhub 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
data/README.textile CHANGED
@@ -1 +1,58 @@
1
- h2. The Ruby Client library for SendHub.net
1
+ h2. The Ruby Client library for SendHub.net
2
+
3
+ SendHub is an outbound 'transactional mail' web service. It means you don't need to maintain your own
4
+ mail servers and you can get callbacks into your application if mail bounces etc..
5
+
6
+ h2. Setup & Installation
7
+
8
+ Create an account on "SendHub":http://sendhub.net/ to obtain your API keys
9
+
10
+ <code>sudo gem install sendhub</code>
11
+
12
+ h2. Simple Ruby Example
13
+
14
+ <pre><code>client = Sendhub::Client.new(
15
+ :api_key => 'YOUR_API_KEY',
16
+ :secret_key => 'YOUR_SECRET_KEY'
17
+ )
18
+
19
+ res = client.send_email(
20
+ :from => 'me@example.com',
21
+ :to => 'you@example.com',
22
+ :subject => 'Testing SendHub Integration',
23
+ :body => 'Testing...'
24
+ )
25
+ </code></pre>
26
+
27
+ h2. Rails 2.x Example
28
+
29
+ config/enviroment.rb
30
+
31
+ <pre><code>config.gem 'sendhub'
32
+ require 'sendhub'
33
+ </code></pre>
34
+
35
+ config/enviroments/production.rb
36
+
37
+ <pre><code>config.action_mailer.delivery_method = :sendhub
38
+ config.action_mailer.sendhub_settings = {
39
+ :api_key => "YOUR_API_KEY",
40
+ :secret_key => "YOUR_SECRET_KEY"
41
+ }
42
+ </code></pre>
43
+
44
+ h2. Rails 3.x Example
45
+
46
+ config/enviroment.rb
47
+
48
+ <pre><code>config.gem 'sendhub'
49
+ </code></pre>
50
+
51
+ config/enviroments/production.rb
52
+
53
+ <pre><code>config.action_mailer.delivery_method = :sendhub
54
+ config.action_mailer.sendhub_settings = {
55
+ :api_key => "YOUR_API_KEY",
56
+ :secret_key => "YOUR_SECRET_KEY"
57
+ }
58
+ </code></pre>
@@ -1,7 +1,7 @@
1
1
  module Sendhub
2
2
  class Client
3
3
 
4
- VERSION = '0.1.7'
4
+ VERSION = '0.1.8'
5
5
 
6
6
  def initialize(config=nil)
7
7
  config[:host] ||= 'api.sendhub.net'
@@ -1,8 +1,18 @@
1
1
  module SendhubMethods
2
+
3
+ def self.included(base)
4
+ base.extend(ClassMethods)
5
+ end
6
+
7
+ module ClassMethods
8
+ @sendhub_settings = {}
9
+ attr_accessor :sendhub_settings
10
+ end
11
+
2
12
  def perform_delivery_sendhub(message)
3
13
  client = Sendhub::Client.new(
4
- :api_key => @@sendhub_settings[:api_key],
5
- :secret_key => @@sendhub_settings[:secret_key]
14
+ :api_key => ActionMailer::Base.sendhub_settings[:api_key],
15
+ :secret_key => ActionMailer::Base.sendhub_settings[:secret_key]
6
16
  )
7
17
  res = client.send_email(
8
18
  :from => message.from,
@@ -13,16 +23,6 @@ module SendhubMethods
13
23
  )
14
24
  end
15
25
 
16
- def self.included(base)
17
- base.extend(ClassMethods)
18
- end
19
-
20
- module ClassMethods
21
- def sendhub_settings=(options)
22
- @@sendhub_settings = options
23
- end
24
- end
25
-
26
26
  end
27
27
 
28
28
  class ActionMailer::Base
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sendhub
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 7
10
- version: 0.1.7
9
+ - 8
10
+ version: 0.1.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Richard Taylor
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-04 00:00:00 +01:00
18
+ date: 2010-09-06 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency