sendgrid-rails 3.0.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +5 -1
- data/lib/send_grid.rb +1 -1
- data/lib/send_grid/api_header.rb +5 -0
- data/lib/send_grid/version.rb +1 -1
- data/spec/api_header_spec.rb +5 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ae5d873d9e18ffc5cc8b72b14ff451165f8f994
|
4
|
+
data.tar.gz: 3e71eec07bc71b8cd8dd093ca4adc8ed02d873f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f03fd53a91dee556be1f9dfebd15db64c055106fad3832e2be47dc1e2115005bdbb1d08e3b01a37262e27b425a7b5f1ba155b0defeab6492b4e21a16892a8ef
|
7
|
+
data.tar.gz: 6400274bd5c3184e8ea3ee3632bd16d1a40f5ecdbd35d453200798105f06a365a1d269c820ee1fa75ab9a6608a05650e032f90bd9d456ff4855e11393024cafc
|
data/README.rdoc
CHANGED
@@ -119,9 +119,13 @@ Add an invisible image at the end of the email to track e-mail opens. If the ema
|
|
119
119
|
|
120
120
|
== Change log
|
121
121
|
|
122
|
+
*v3.1.0*
|
123
|
+
|
124
|
+
* Introduced `template_id` feature
|
125
|
+
|
122
126
|
*v3.0.0*
|
123
127
|
|
124
|
-
* Depricated method `:alias_method_chain` has been replaced with `Module#prepend` Ruby 2.0 feature
|
128
|
+
* Depricated method `:alias_method_chain` has been replaced with `Module#prepend` Ruby 2.0 feature
|
125
129
|
* Requires Ruby 2.0+
|
126
130
|
|
127
131
|
*v2.0.5*
|
data/lib/send_grid.rb
CHANGED
@@ -7,7 +7,7 @@ module SendGrid
|
|
7
7
|
def self.included(base)
|
8
8
|
base.class_eval do
|
9
9
|
prepend InstanceMethods
|
10
|
-
delegate :substitute, :uniq_args, :category, :add_filter_setting, :deliver_at, :to => :sendgrid_header
|
10
|
+
delegate :substitute, :uniq_args, :category, :add_filter_setting, :deliver_at, :template_id, :to => :sendgrid_header
|
11
11
|
alias_method :sendgrid_header, :send_grid_header
|
12
12
|
end
|
13
13
|
end
|
data/lib/send_grid/api_header.rb
CHANGED
@@ -30,6 +30,11 @@ class SendGrid::ApiHeader
|
|
30
30
|
@data[:send_at] = timestamp
|
31
31
|
end
|
32
32
|
|
33
|
+
def template_id(temp_id)
|
34
|
+
add_filter_setting('templates', 'enable', '1')
|
35
|
+
add_filter_setting('templates', 'template_id', temp_id)
|
36
|
+
end
|
37
|
+
|
33
38
|
def to_json
|
34
39
|
JSON.generate(@data, :array_nl => ' ')
|
35
40
|
end
|
data/lib/send_grid/version.rb
CHANGED
data/spec/api_header_spec.rb
CHANGED
@@ -38,6 +38,11 @@ describe SendGrid::ApiHeader do
|
|
38
38
|
header.to_json.should eql "{\"send_at\":#{ts}}"
|
39
39
|
end
|
40
40
|
|
41
|
+
it "contains template_id" do
|
42
|
+
header.template_id 'template_id_1'
|
43
|
+
header.to_json.should eql '{"filters":{"templates":{"settings":{"enable":"1","template_id":"template_id_1"}}}}'
|
44
|
+
end
|
45
|
+
|
41
46
|
it "contains filter settings" do
|
42
47
|
header.add_filter_setting :filter1, :setting1, 'val1'
|
43
48
|
header.to_json.should eql '{"filters":{"filter1":{"settings":{"setting1":"val1"}}}}'
|