mailgun_rails 0.5.6 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -33,6 +33,7 @@ module Mailgun
33
33
  transform_reply_to rails_message, mailgun_message if rails_message.reply_to
34
34
  transform_mailgun_variables rails_message, mailgun_message
35
35
  transform_mailgun_recipient_variables rails_message, mailgun_message
36
+ transform_custom_headers rails_message, mailgun_message
36
37
  end
37
38
 
38
39
  def build_basic_mailgun_message_for(rails_message)
@@ -67,6 +68,12 @@ module Mailgun
67
68
  end
68
69
  end
69
70
 
71
+ def transform_custom_headers(rails_message, mailgun_message)
72
+ rails_message.mailgun_headers.try(:each) do |name, value|
73
+ mailgun_message["h:#{name}"] = value
74
+ end
75
+ end
76
+
70
77
  def transform_mailgun_recipient_variables(rails_message, mailgun_message)
71
78
  mailgun_message['recipient-variables'] = rails_message.mailgun_recipient_variables.to_json if rails_message.mailgun_recipient_variables
72
79
  end
@@ -2,5 +2,6 @@ module Mail
2
2
  class Message
3
3
  attr_accessor :mailgun_variables
4
4
  attr_accessor :mailgun_recipient_variables
5
+ attr_accessor :mailgun_headers
5
6
  end
6
- end
7
+ end
@@ -1,3 +1,3 @@
1
1
  module Mailgun
2
- VERSION = "0.5.6"
2
+ VERSION = "0.6.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailgun_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.6.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-14 00:00:00.000000000 Z
12
+ date: 2014-01-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -105,7 +105,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
105
105
  version: '0'
106
106
  segments:
107
107
  - 0
108
- hash: 1001558418500426276
108
+ hash: 2720942027674602409
109
109
  required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  none: false
111
111
  requirements:
@@ -114,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
114
  version: '0'
115
115
  segments:
116
116
  - 0
117
- hash: 1001558418500426276
117
+ hash: 2720942027674602409
118
118
  requirements: []
119
119
  rubyforge_project:
120
120
  rubygems_version: 1.8.23