planet_express 0.0.8 → 0.1.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/.gemset-version ADDED
@@ -0,0 +1 @@
1
+ planet_express
File without changes
data/CHANGELOG.md CHANGED
@@ -1,6 +1,38 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ ### 0.1.0
5
+ - Including `<SAVE_COLUMNS>` inside the XML request.
6
+
7
+ > To save the personalization values in the Engage database,
8
+ > you must create the fields in your database and use the SAVE_COLUMN element
9
+ > for that XML tag.
10
+
11
+ ```
12
+ <XTMAILING>
13
+ <CAMPAIGN_ID>numeric CAMPAIGN id</CAMPAIGN_ID>
14
+ <TRANSACTION_ID>TRANS-1234</TRANSACTION_ID>
15
+ <SHOW_ALL_SEND_DETAIL>false</SHOW_ALL_SEND_DETAIL>
16
+ <SEND_AS_BATCH>false</SEND_AS_BATCH>
17
+ <NO_RETRY_ON_FAILURE >false</NO_RETRY_ON_FAILURE>
18
+ <SAVE_COLUMNS>
19
+ <COLUMN_NAME>ACCOUNT_ID</COLUMN_NAME>
20
+ </SAVE_COLUMNS>
21
+ <RECIPIENT>
22
+ <EMAIL>person@domain.com</EMAIL>
23
+ <BODY_TYPE>HTML</BODY_TYPE>
24
+ <PERSONALIZATION>
25
+ <TAG_NAME>ACCOUNT_ID</TAG_NAME>
26
+ <VALUE>807</VALUE>
27
+ </PERSONALIZATION>
28
+ <PERSONALIZATION>
29
+ <TAG_NAME>TRANSACT_MAIL_BODY</TAG_NAME>
30
+ <VALUE><![CDATA[<p>Click this link: <a href="http://foo">link</a><p>]]></VALUE>
31
+ </PERSONALIZATION>
32
+ </RECIPIENT>
33
+ </XTMAILING>
34
+ ```
35
+
4
36
  ### 0.0.8
5
37
  - Removing log4r and use Rails.logger instead (fix for isssue #1)
6
38
 
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source :rubygems
1
+ source 'https://rubygems.org'
2
2
  ruby '1.9.3'
3
3
 
4
4
  # Specify your gem's dependencies in planet_express.gemspec
data/Gemfile.lock CHANGED
@@ -1,16 +1,16 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- planet_express (0.0.7)
4
+ planet_express (0.1.0)
5
5
  activesupport
6
6
  hpricot
7
7
  log4r
8
8
 
9
9
  GEM
10
- remote: http://rubygems.org/
10
+ remote: https://rubygems.org/
11
11
  specs:
12
- activesupport (3.2.8)
13
- i18n (~> 0.6)
12
+ activesupport (3.2.13)
13
+ i18n (= 0.6.1)
14
14
  multi_json (~> 1.0)
15
15
  awesome_print (1.1.0)
16
16
  coderay (1.0.8)
@@ -29,7 +29,7 @@ GEM
29
29
  listen (0.5.3)
30
30
  log4r (1.1.10)
31
31
  method_source (0.7.1)
32
- multi_json (1.3.7)
32
+ multi_json (1.7.2)
33
33
  pry (0.9.9.6)
34
34
  coderay (~> 1.0.5)
35
35
  method_source (~> 0.7.1)
data/README.md CHANGED
@@ -23,9 +23,9 @@ Then create a new deliver, prepare the ship and deliver it!
23
23
  ```
24
24
  require 'planet_express'
25
25
 
26
- recipient = 'mariozaizar@gmail.com'
27
- package_id = 1807752
28
- cargo = { bill_float_test_body: "<h1>Good news everyone!</h1><img src='http://goo.gl/XazeH'>" }
26
+ recipient = 'email@test.com'
27
+ package_id = 432524234
28
+ cargo = { html_body_text: "<h1>Good news everyone!</h1><img src='http://goo.gl/XazeH'>" }
29
29
 
30
30
  job = PlanetExpress::Delivery.new
31
31
  request = job.prepare package_id, recipient, cargo
@@ -60,4 +60,14 @@ Contributing
60
60
  4. Push to the branch (`git push origin my-new-feature`)
61
61
  5. Create new Pull Request
62
62
 
63
+ Build
64
+ -----
65
+
66
+ 1. Do changes.
67
+ 2. Increase the `version.rb` using <http://semver.org/> pattern.
68
+ 3. Run specs
69
+ 4. Commit changes
70
+ 5. Release to RubyGems.org with `rake release`
71
+ 6. Fun
72
+
63
73
  **@MarioZaizar**
data/doc/silverpop_api.md CHANGED
@@ -8,20 +8,19 @@ We're using this <https://transact5.silverpop.com/XTMail> end point.
8
8
  ```
9
9
  <?xml version='1.0' encoding='UTF-8' standalone='yes'?>
10
10
  <XTMAILING>
11
- <CAMPAIGN_ID>1807752</CAMPAIGN_ID>
11
+ <CAMPAIGN_ID>792430</CAMPAIGN_ID>
12
12
  <SHOW_ALL_SEND_DETAIL>true</SHOW_ALL_SEND_DETAIL>
13
13
  <SEND_AS_BATCH>false</SEND_AS_BATCH>
14
14
  <NO_RETRY_ON_FAILURE>false</NO_RETRY_ON_FAILURE>
15
+ <SAVE_COLUMNS>
16
+ <COLUMN_NAME>first_name</COLUMN_NAME>
17
+ </SAVE_COLUMNS>
15
18
  <RECIPIENT>
16
19
  <EMAIL>mariozaizar@gmail.com</EMAIL>
17
20
  <BODY_TYPE>HTML</BODY_TYPE>
18
21
  <PERSONALIZATION>
19
- <TAG_NAME>first_name</TAG_NAME>
20
- <VALUE><![CDATA[Mario]]></VALUE>
21
- </PERSONALIZATION>
22
- <PERSONALIZATION>
23
- <TAG_NAME>last_name</TAG_NAME>
24
- <VALUE><![CDATA[Zaizar]]></VALUE>
22
+ <TAG_NAME>data</TAG_NAME>
23
+ <VALUE><![CDATA[{:first_name=>\"Mario Alberto\"}]]></VALUE>
25
24
  </PERSONALIZATION>
26
25
  </RECIPIENT>
27
26
  </XTMAILING>
@@ -41,7 +41,7 @@ module PlanetExpress
41
41
  private
42
42
 
43
43
  def build_request
44
- fields_xml = ''
44
+ fields_xml = columns = ''
45
45
 
46
46
  @personalizations.each_pair do |name, value|
47
47
  fields_xml +=
@@ -49,6 +49,9 @@ module PlanetExpress
49
49
  " <TAG_NAME>#{name}</TAG_NAME>\n" +
50
50
  " <VALUE><![CDATA[#{value}]]></VALUE>\n" +
51
51
  " </PERSONALIZATION>\n"
52
+
53
+ personalization_names +=
54
+ " <COLUMN_NAME>#{name}</COLUMN_NAME>\n"
52
55
  end
53
56
 
54
57
  recipient_xml =
@@ -58,6 +61,14 @@ module PlanetExpress
58
61
  "#{fields_xml}" +
59
62
  " </RECIPIENT>\n"
60
63
 
64
+ # To save the personalization values in the Engage database,
65
+ # you must create the fields in your database and use the SAVE_COLUMN
66
+ # element for that XML tag.
67
+ save_columns_xml =
68
+ " <SAVE_COLUMNS>\n" +
69
+ "#{personalization_names}" +
70
+ " </SAVE_COLUMNS>\n" +
71
+
61
72
  @request =
62
73
  "<?xml version='1.0' encoding='UTF-8' standalone='yes'?>\n" +
63
74
  "<XTMAILING>\n" +
@@ -66,6 +77,8 @@ module PlanetExpress
66
77
  " <SEND_AS_BATCH>false</SEND_AS_BATCH>\n" +
67
78
  " <NO_RETRY_ON_FAILURE>false</NO_RETRY_ON_FAILURE>\n" +
68
79
  # " <TRANSACTION_ID>" + @transaction_id + "</TRANSACTION_ID>\n" +
80
+
81
+ "#{save_columns_xml}" +
69
82
  "#{recipient_xml}" +
70
83
  "</XTMAILING>\n"
71
84
 
@@ -1,3 +1,3 @@
1
1
  module PlanetExpress
2
- VERSION = "0.0.8"
2
+ VERSION = "0.1.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.0.8
4
+ version: 0.1.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: 2012-12-05 00:00:00.000000000 Z
12
+ date: 2013-05-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -164,9 +164,9 @@ extensions: []
164
164
  extra_rdoc_files: []
165
165
  files:
166
166
  - .document
167
+ - .gemset-version
167
168
  - .gitignore
168
- - .rbenv-version
169
- - .rvmrc
169
+ - .ruby-version
170
170
  - CHANGELOG.md
171
171
  - Gemfile
172
172
  - Gemfile.lock
data/.rvmrc DELETED
@@ -1 +0,0 @@
1
- rvm use 1.9.3-p194@planet_express --create --install