amazon-ses 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -4,7 +4,7 @@ A gem for interfacing with Amazon's Simple Email Service
4
4
  ==Features:
5
5
  Currently you can:
6
6
  * Send a basic raw text email.
7
- * Send email with a .erb template
7
+ * Send email with a .erb template (Text or HTML)
8
8
 
9
9
 
10
10
  ==Prerequisite
@@ -44,6 +44,20 @@ Currently you can:
44
44
  }
45
45
 
46
46
  e = AmazonEmail.new(options_2)
47
+
48
+ * Email multiple people
49
+ You can achieve this by sending a Array in the :to field of the options
50
+
51
+ options_3 = {
52
+ :from => 'from@email.com',
53
+ :to => ['to@email.com', 'to_2@email.com', 'to_3@email.com'],
54
+ :subject => 'This is the subject of the email',
55
+ :aws_access_key => "access_key_id",
56
+ :aws_secret_key => "secret_access_key",
57
+ :template => File.new("sample_email.erb").read
58
+ }
59
+ e = AmazinEmail.new(options_3)
60
+
47
61
 
48
62
  2. Send it
49
63
 
@@ -3,7 +3,12 @@ module AmazonAuthentication
3
3
 
4
4
  def self.key(aws_private, date)
5
5
  hmac = OpenSSL::HMAC.digest(DIGEST, aws_private, date.to_s)
6
- b64 = Base64.b64encode(hmac)
6
+ # make ruby 1.9 compatible
7
+ if RUBY_VERSION < '1.9'
8
+ b64 = Base64.b64encode(hmac)
9
+ else
10
+ b64 = Base64.encode64(hmac)
11
+ end
7
12
  end
8
13
 
9
- end
14
+ end
@@ -1,5 +1,5 @@
1
1
  module AmazonUrlGenerator
2
2
  def self.create_query(from, to, subject, body)
3
- "/?Action=SendEmail&Source=#{URI.escape(from, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))}&Destination.ToAddresses.member.1=#{URI.escape(to, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))}&Message.Subject.Data=#{URI.escape(subject, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))}&Message.Body.Text.Data=#{URI.escape(body, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))}"
3
+ "/?Action=SendEmail&Source=#{URI.escape(from, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))}&Destination.ToAddresses.member.1=#{URI.escape(to, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))}&Message.Subject.Data=#{URI.escape(subject, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))}&Message.Body.Html.Data=#{URI.escape(body, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))}"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amazon-ses
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Guille Carlos
@@ -15,12 +15,12 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-05 00:00:00 -05:00
18
+ date: 2011-05-20 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
22
22
  description: A easy way to interact with Amazon SES.
23
- email: gcarlos1@gmail.com
23
+ email: ramon.g.carlos@gmail.com
24
24
  executables: []
25
25
 
26
26
  extensions: []