constant_contact 1.3.3 → 1.4.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.
@@ -28,28 +28,22 @@ module ConstantContact
28
28
  def to_xml
29
29
  xml = Builder::XmlMarkup.new
30
30
  xml.tag!("Campaign", :xmlns => "http://ws.constantcontact.com/ns/1.0/") do
31
- self.attributes.each{ |k, v| xml.tag!(k.to_s.camelize, v) }
31
+ self.attributes.reject {|k,v| k == 'FromEmail' || k == 'ReplyToEmail' || k == 'ContactList'}.each{|k, v| xml.tag!( k.to_s.camelize, v )}
32
32
  # Overrides the default formatting above to CC's required format.
33
33
  xml.tag!("ReplyToEmail") do
34
- xml.tag!('Email', :id => self.reply_to_email_url)
34
+ xml.tag!('Email', :id => self.reply_to_email_url)
35
35
  end
36
36
  xml.tag!("FromEmail") do
37
- xml.tag!('Email', :id => self.from_email_url)
37
+ xml.tag!('Email', :id => self.from_email_url)
38
38
  end
39
39
  xml.tag!("ContactLists") do
40
- xml.tag!("ContactList", :id => self.list_url)
40
+ xml.tag!("ContactList", :id => self.contact_list)
41
41
  end
42
42
  end
43
43
  end
44
44
 
45
- def list_url
46
- id = defined?(self.list_id) ? self.list_id : 1
47
- List.find(id).id
48
- end
49
-
50
45
  def from_email_url
51
- id = defined?(self.from_email_id) ? self.from_email_id : 1
52
- EmailAddress.find(id).id
46
+ EmailAddress.find(self.from_email).id
53
47
  end
54
48
 
55
49
  def reply_to_email_url
@@ -62,9 +56,9 @@ module ConstantContact
62
56
  self.view_as_webpage = 'NO' unless attributes.has_key?('ViewAsWebpage')
63
57
  self.from_name = self.class.user unless attributes.has_key?('FromName')
64
58
  self.permission_reminder = 'YES' unless attributes.has_key?('PermissionReminder')
65
- self.permission_reminder_text = %Q{You're receiving this email because of your relationship with us. Please <ConfirmOptin><a style="color:#0000ff;">confirm</a></ConfirmOptin> your continued interest in receiving email from us.} unless attributes.has_key?('PermissionReminderText')
59
+ self.permission_reminder_text = 'You\'re receiving this email because of your relationship with us. Please <ConfirmOptin><a style="color:#0000ff;">confirm</a></ConfirmOptin> your continued interest in receiving email from us.' unless attributes.has_key?('PermissionReminderText')
66
60
  self.greeting_salutation = 'Dear' unless attributes.has_key?('GreetingSalutation')
67
- self.greeting_name = "FirstName" unless attributes.has_key?('GreetingName')
61
+ self.greeting_name = 'FirstName' unless attributes.has_key?('GreetingName')
68
62
  self.greeting_string = 'Greetings!' unless attributes.has_key?('GreetingString')
69
63
  self.status = 'DRAFT' unless attributes.has_key?('Status')
70
64
  self.style_sheet = '' unless attributes.has_key?('StyleSheet')
@@ -1,3 +1,3 @@
1
1
  module ConstantContact
2
- VERSION = '1.3.3'.freeze
2
+ VERSION = '1.4.0'.freeze
3
3
  end
@@ -56,7 +56,7 @@ class Activity < Test::Unit::TestCase
56
56
 
57
57
  context 'format' do
58
58
  should 'be html encoded' do
59
- assert_equal ActiveResource::Formats[:html_encoded], ConstantContact::Activity.connection.format
59
+ assert_equal ActiveResource::Formats[:html_encoded], ConstantContact::Activity.format
60
60
  end
61
61
  end
62
62
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: constant_contact
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
5
- prerelease: false
4
+ hash: 7
5
+ prerelease:
6
6
  segments:
7
7
  - 1
8
- - 3
9
- - 3
10
- version: 1.3.3
8
+ - 4
9
+ - 0
10
+ version: 1.4.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tim Case
@@ -18,7 +18,7 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2011-01-12 00:00:00 -05:00
21
+ date: 2011-02-18 00:00:00 -05:00
22
22
  default_executable:
23
23
  dependencies:
24
24
  - !ruby/object:Gem::Dependency
@@ -192,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
192
192
  requirements: []
193
193
 
194
194
  rubyforge_project:
195
- rubygems_version: 1.3.7
195
+ rubygems_version: 1.5.0
196
196
  signing_key:
197
197
  specification_version: 3
198
198
  summary: ActiveResource wrapper for the Constant Contact API.