planet_express 0.2.0 → 1.0.0

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/CHANGELOG.md CHANGED
@@ -1,17 +1,21 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ ### 1.0.0 Don't log as ERROR (let the host decide if is an error or not)
5
+ - Decrease the logger level from "error" to "warn" when status == 2
6
+ - Bump version to v1.0.0.
7
+
4
8
  ### 0.2.0 Make sure default personalizations (TIMESTAMP and EMAIL_TEMPLATE are uppercase)
5
9
 
6
10
  ### 0.1.6 Add more details when an error response is processed.
7
11
 
8
12
  ### 0.1.5 Removing some error loggers.
9
13
 
10
- ### 0.1.4
14
+ ### 0.1.4 Misc
11
15
 
12
16
  ### 0.1.4 Fixing EOF error
13
17
 
14
- ### 0.1.3
18
+ ### 0.1.3 Misc
15
19
 
16
20
  - Don't use SSL by default: `http.use_ssl = false`.
17
21
  - Return the full response and log the response stats to logger.
@@ -19,7 +19,12 @@ module PlanetExpress
19
19
 
20
20
  def prepare campaign_id, recipient, personalizations={}
21
21
  @campaign_id, @recipient, @personalizations = campaign_id, recipient, personalizations
22
- @personalizations.merge!({ :TIMESTAMP => Time.now, :EMAIL_TEMPLATE => @campaign_id })
22
+
23
+ @personalizations.merge!({
24
+ :TIMESTAMP => Time.now,
25
+ :EMAIL_TEMPLATE => @campaign_id
26
+ })
27
+
23
28
  raise PlanetExpress::ArgumentError if campaign_id.nil? or recipient.nil?
24
29
 
25
30
  build_request
@@ -97,11 +102,11 @@ module PlanetExpress
97
102
  emails_sent = @response.at('EMAILS_SENT').innerHTML
98
103
 
99
104
  if status == 2
100
- logger.error "PlanetExpress error: #{error_string}, response: #{response}"
105
+ logger.warn "PlanetExpress WARN: '#{error_string}', response: #{response}"
101
106
  end
102
107
 
103
- logger.warn "PlanetExpress can't retrieve the response!" if @response.nil?
104
- logger.info "PlanetExpress delivered (#{emails_sent}/#{recipients_received}) emails."
108
+ logger.warn "PlanetExpress WARN: can't retrieve the response!" if @response.nil?
109
+ logger.info "PlanetExpress INFO: delivered (#{emails_sent}/#{recipients_received}) emails."
105
110
  response
106
111
  end
107
112
  end
@@ -1,3 +1,3 @@
1
1
  module PlanetExpress
2
- VERSION = "0.2.0"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: planet_express
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 1.0.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: 2014-07-01 00:00:00.000000000 Z
12
+ date: 2015-04-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport