sendgrid 1.2.0 → 1.2.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.0
1
+ 1.2.4
@@ -28,7 +28,7 @@ module SendGrid
28
28
  :default_footer_text, :default_spamcheck_score, :default_sg_unique_args
29
29
  end
30
30
  attr_accessor :sg_category, :sg_options, :sg_disabled_options, :sg_recipients, :sg_substitutions,
31
- :subscriptiontrack_text, :footer_text, :spamcheck_score, :sg_unique_args
31
+ :subscriptiontrack_text, :footer_text, :spamcheck_score, :sg_unique_args, :sg_send_at
32
32
  end
33
33
 
34
34
  # NOTE: This commented-out approach may be a "safer" option for Rails 3, but it
@@ -103,6 +103,11 @@ module SendGrid
103
103
  @sg_category = category
104
104
  end
105
105
 
106
+ # Call within mailer method to set send time for this mail
107
+ def sendgrid_send_at(utc_timestamp)
108
+ @sg_send_at = utc_timestamp
109
+ end
110
+
106
111
  # Call within mailer method to set unique args for this email.
107
112
  # Merged with class-level unique args, if any exist.
108
113
  def sendgrid_unique_args(unique_args = {})
@@ -221,6 +226,9 @@ module SendGrid
221
226
  header_opts[:category] = self.class.default_sg_category
222
227
  end
223
228
 
229
+ #Set send_at if set by the user
230
+ header_opts[:send_at] = @sg_send_at unless @sg_send_at.blank?
231
+
224
232
  # Set multi-recipients
225
233
  if @sg_recipients && !@sg_recipients.empty?
226
234
  header_opts[:to] = @sg_recipients
@@ -0,0 +1,11 @@
1
+ require 'rails'
2
+
3
+ module SendGrid
4
+ class Railtie < Rails::Railtie # :nodoc:
5
+
6
+ initializer "send_grid.action_mailer" do
7
+ ActiveSupport.on_load(:action_mailer) { ActionMailer::Base.send(:include, SendGrid) }
8
+ end
9
+
10
+ end
11
+ end
@@ -0,0 +1,3 @@
1
+ module SendGrid #:nodoc:
2
+ VERSION = "2.0.0"
3
+ end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "sendgrid"
8
- s.version = "1.2.0"
8
+ s.version = "1.2.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Stephen Blankenship", "Marc Tremblay", "Bob Burbach"]
12
- s.date = "2013-05-15"
12
+ s.date = "2016-01-08"
13
13
  s.description = "This gem allows simple integration between ActionMailer and SendGrid. \n SendGrid is an email deliverability API that is affordable and has lots of bells and whistles."
14
14
  s.email = "stephenrb@gmail.com"
15
15
  s.extra_rdoc_files = [
@@ -25,13 +25,15 @@ Gem::Specification.new do |s|
25
25
  "Rakefile",
26
26
  "VERSION",
27
27
  "lib/sendgrid.rb",
28
+ "lib/sendgrid/railtie.rb",
29
+ "lib/sendgrid/version.rb",
28
30
  "sendgrid.gemspec",
29
31
  "test/sendgrid_test.rb",
30
32
  "test/test_helper.rb"
31
33
  ]
32
34
  s.homepage = "http://github.com/stephenb/sendgrid"
33
35
  s.require_paths = ["lib"]
34
- s.rubygems_version = "1.8.24"
36
+ s.rubygems_version = "1.8.23"
35
37
  s.summary = "A gem that allows simple integration of ActionMailer with SendGrid (http://sendgrid.com)"
36
38
 
37
39
  if s.respond_to? :specification_version then
@@ -5,13 +5,13 @@ class SendgridTest < Test::Unit::TestCase
5
5
  ActionMailer::Base.delivery_method = :test
6
6
  ActionMailer::Base.perform_deliveries = true
7
7
  ActionMailer::Base.deliveries = []
8
-
8
+
9
9
  @options = {
10
10
  :to => ['test@example.com'],
11
11
  :from => 'test@example.com',
12
12
  :reply_to => 'reply-to@example.com',
13
13
  :subject => 'The Subject',
14
- :html_content => '<html>content</html>',
14
+ :body => '<html>content</html>',
15
15
  :category => 'MyCategory',
16
16
  :substitutions => {
17
17
  'first_name' => ['Joe'],
@@ -19,17 +19,17 @@ class SendgridTest < Test::Unit::TestCase
19
19
  }
20
20
  }
21
21
  end
22
-
22
+
23
23
  should "require the same number of items in a substitution array as is in the recipient array" do
24
24
  assert_raise ArgumentError do
25
25
  test_email = SendgridCampaignTestMailer.create_test(@options).deliver
26
26
  end
27
27
  end
28
-
28
+
29
29
  should "accept a hash of unique args at the class level" do
30
30
  assert_equal ({ :test_arg => "test value" }), SendgridUniqueArgsMailer.default_sg_unique_args
31
31
  end
32
-
32
+
33
33
  should "pass unique args from both the mailer class and the mailer method through custom headers" do
34
34
  @options.delete(:substitutions)
35
35
  SendgridUniqueArgsMailer.unique_args_test_email(@options).deliver
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sendgrid
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-05-15 00:00:00.000000000 Z
14
+ date: 2016-01-08 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: json
@@ -111,6 +111,8 @@ files:
111
111
  - Rakefile
112
112
  - VERSION
113
113
  - lib/sendgrid.rb
114
+ - lib/sendgrid/railtie.rb
115
+ - lib/sendgrid/version.rb
114
116
  - sendgrid.gemspec
115
117
  - test/sendgrid_test.rb
116
118
  - test/test_helper.rb
@@ -134,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
136
  version: '0'
135
137
  requirements: []
136
138
  rubyforge_project:
137
- rubygems_version: 1.8.24
139
+ rubygems_version: 1.8.23
138
140
  signing_key:
139
141
  specification_version: 3
140
142
  summary: A gem that allows simple integration of ActionMailer with SendGrid (http://sendgrid.com)