postageapp 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  This is the gem used to integrate Ruby apps with PostageApp service.
5
5
  Personalized, mass email sending can be offloaded to PostageApp via JSON based API.
6
6
 
7
- ### [API Documentation](http://help.postageapp.com/faqs/api-reference) • [PostageApp FAQs](http://help.postageapp.com/faqs) • [PostageApp Help Portal](http://help.postageapp.com)
7
+ ### [API Documentation](http://help.postageapp.com/faqs/api) • [PostageApp FAQs](http://help.postageapp.com/faqs) • [PostageApp Help Portal](http://help.postageapp.com)
8
8
 
9
9
  Installation
10
10
  ------------
@@ -45,7 +45,7 @@ And then it's as simple as doing something like this:
45
45
 
46
46
  Usage
47
47
  -----
48
- Here's an example of sending a message ([See full API documentation](http://help.postageapp.com/faqs/api-reference/send_message)):
48
+ Here's an example of sending a message ([See full API documentation](http://help.postageapp.com/faqs/api/send_message)):
49
49
 
50
50
  request = PostageApp::Request.new(:send_message, {
51
51
  'headers' => { 'from' => 'sender@example.com',
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.2
1
+ 1.0.3
@@ -82,6 +82,11 @@ class PostageApp::Mailer < ActionMailer::Base
82
82
  @_attachments ||= Attachments.new(@_message)
83
83
  end
84
84
 
85
+ # Override for headers assignment
86
+ def headers(args=nil)
87
+ @_message.headers(args)
88
+ end
89
+
85
90
  # Overriding method that prepares Mail object. This time we'll be
86
91
  # contructing PostageApp::Request payload.
87
92
  def mail(headers = {}, &block)
@@ -111,7 +116,7 @@ class PostageApp::Mailer < ActionMailer::Base
111
116
 
112
117
  # Assign all headers except parts_order, content_type and body
113
118
  assignable = headers.except(:parts_order, :content_type, :body, :template_name, :template_path)
114
- m.arguments['headers'] = assignable
119
+ m.headers.merge!(assignable)
115
120
 
116
121
  # Render the templates and blocks
117
122
  responses, explicit_order = collect_responses_and_parts_order(headers, &block)
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{postageapp}
8
- s.version = "1.0.2"
8
+ s.version = "1.0.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Oleg Khabarov, The Working Group Inc"]
12
- s.date = %q{2010-07-26}
12
+ s.date = %q{2010-07-27}
13
13
  s.description = %q{Gem that interfaces with PostageApp.com service to send emails from web apps}
14
14
  s.email = %q{oleg@twg.ca}
15
15
  s.extra_rdoc_files = [
@@ -44,6 +44,9 @@ class Notifier < PostageApp::Mailer
44
44
  end
45
45
 
46
46
  def with_custom_postage_variables
47
+ headers['CustomHeader1'] = 'CustomValue1'
48
+ headers 'CustomHeader2' => 'CustomValue2'
49
+
47
50
  postage_template 'test_template'
48
51
  postage_variables 'variable' => 'value'
49
52
 
@@ -64,6 +64,8 @@ class Mailer3Test < Test::Unit::TestCase
64
64
  }), mail.arguments['recipients']
65
65
  assert_equal 'test_template', mail.arguments['template']
66
66
  assert_equal ({ 'variable' => 'value' }), mail.arguments['variables']
67
+ assert_equal 'CustomValue1', mail.arguments['headers']['CustomHeader1']
68
+ assert_equal 'CustomValue2', mail.arguments['headers']['CustomHeader2']
67
69
  end
68
70
 
69
71
  def test_create_with_old_api
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 2
9
- version: 1.0.2
8
+ - 3
9
+ version: 1.0.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Oleg Khabarov, The Working Group Inc
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-07-26 00:00:00 -04:00
17
+ date: 2010-07-27 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency