sendgrid 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.textile +13 -1
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/sendgrid.rb +1 -1
- data/test/sendgrid_test.rb +23 -3
- data/test/test_helper.rb +3 -0
- data/test/test_mailers/kitchen_sink_mailer.rb +11 -0
- metadata +14 -4
data/README.textile
CHANGED
@@ -8,7 +8,19 @@ Visit "SendGrid":http://sendgrid.com to learn more.
|
|
8
8
|
|
9
9
|
h3. Getting Started
|
10
10
|
|
11
|
-
First of all, you'll need the gem.
|
11
|
+
First of all, you'll need the gem. You can add sendgrid to your Rails requirements:
|
12
|
+
<pre>
|
13
|
+
config.gem "sendgrid", :source => 'http://gemcutter.org'
|
14
|
+
</pre>
|
15
|
+
|
16
|
+
Or, you can install it as a gem:
|
17
|
+
<pre>
|
18
|
+
# if you haven't already, add gemcutter to your gem sources
|
19
|
+
sudo gem install gemcutter
|
20
|
+
gem tumble
|
21
|
+
# install sendgrid
|
22
|
+
sudo gem install sendgrid
|
23
|
+
</pre>
|
12
24
|
|
13
25
|
Before you can do anything with the sendgrid gem, you'll need to create your very own SendGrid account. Go ahead and do so at "http://sendgrid.com":http://sendgrid.com (there's even a FREE account option).
|
14
26
|
|
data/Rakefile
CHANGED
@@ -11,7 +11,7 @@ begin
|
|
11
11
|
gem.email = "stephenrb@gmail.com"
|
12
12
|
gem.homepage = "http://github.com/stephenb/sendgrid"
|
13
13
|
gem.authors = ["Stephen Blankenship"]
|
14
|
-
|
14
|
+
gem.add_development_dependency "thoughtbot-shoulda"
|
15
15
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
16
16
|
end
|
17
17
|
Jeweler::GemcutterTasks.new
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.3
|
data/lib/sendgrid.rb
CHANGED
@@ -106,7 +106,7 @@ module SendGrid
|
|
106
106
|
|
107
107
|
# Sets the custom X-SMTPAPI header before sending the email
|
108
108
|
def perform_delivery_smtp(mail)
|
109
|
-
puts "SendGrid X-SMTPAPI: #{sendgrid_json_headers(mail)}" if SENDGRID_DEBUG_OUTPUT
|
109
|
+
puts "SendGrid X-SMTPAPI: #{sendgrid_json_headers(mail)}" if Object.const_defined?("SENDGRID_DEBUG_OUTPUT") && SENDGRID_DEBUG_OUTPUT
|
110
110
|
headers['X-SMTPAPI'] = sendgrid_json_headers(mail)
|
111
111
|
super
|
112
112
|
end
|
data/test/sendgrid_test.rb
CHANGED
@@ -1,7 +1,27 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
-
class
|
4
|
-
|
5
|
-
|
3
|
+
class SendGridTest < Test::Unit::TestCase
|
4
|
+
context "Category Set to :use_subject_lines" do
|
5
|
+
should "send email with X-SMTPAPI header set to email's subject line" do
|
6
|
+
email = KitchenSinkMailer.deliver_test_email
|
7
|
+
assert_equal "Test Email", email.subject
|
8
|
+
end
|
6
9
|
end
|
7
10
|
end
|
11
|
+
|
12
|
+
# class UserMailerTest < ActionMailer::TestCase
|
13
|
+
# tests UserMailer
|
14
|
+
#
|
15
|
+
# def test_welcome_email
|
16
|
+
# user = users(:some_user_in_your_fixtures)
|
17
|
+
#
|
18
|
+
# # Send the email, then test that it got queued
|
19
|
+
# email = UserMailer.deliver_welcome_email(user)
|
20
|
+
# assert !ActionMailer::Base.deliveries.empty?
|
21
|
+
#
|
22
|
+
# # Test the body of the sent email contains what we expect it to
|
23
|
+
# assert_equal [@user.email], email.to
|
24
|
+
# assert_equal "Welcome to My Awesome Site", email.subject
|
25
|
+
# assert_match /Welcome to example.com, #{user.first_name}/, email.body
|
26
|
+
# end
|
27
|
+
# end
|
data/test/test_helper.rb
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'test/unit'
|
3
3
|
require 'shoulda'
|
4
|
+
require 'actionmailer'
|
4
5
|
|
5
6
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
6
7
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
7
8
|
require 'sendgrid'
|
8
9
|
|
9
10
|
class Test::Unit::TestCase
|
11
|
+
ActionMailer::Base.delivery_method = :test
|
12
|
+
ActionMailer::Base.template_root = "/test/test_mailers"
|
10
13
|
end
|
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: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Blankenship
|
@@ -9,10 +9,19 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-11-
|
12
|
+
date: 2009-11-10 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
|
-
dependencies:
|
15
|
-
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: thoughtbot-shoulda
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0"
|
24
|
+
version:
|
16
25
|
description: |-
|
17
26
|
This gem allows simple integration between ActionMailer and SendGrid.
|
18
27
|
SendGrid is an email deliverability API that is affordable and has lots of bells and whistles.
|
@@ -65,3 +74,4 @@ summary: A gem that allows simple integration of ActionMailer with SendGrid (htt
|
|
65
74
|
test_files:
|
66
75
|
- test/sendgrid_test.rb
|
67
76
|
- test/test_helper.rb
|
77
|
+
- test/test_mailers/kitchen_sink_mailer.rb
|