diff --git a/Gemfile.lock b/Gemfile.lock index 9c895ad..9791985 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,28 +3,35 @@ PATH specs: ruby-pardot (1.3.2) crack (= 0.4.3) - httparty (= 0.13.1) + httparty (= 0.18.0) GEM remote: http://rubygems.org/ specs: crack (0.4.3) safe_yaml (~> 1.0.0) - diff-lcs (1.1.2) + diff-lcs (1.3) fakeweb (1.3.0) - httparty (0.13.1) - json (~> 1.8) + httparty (0.18.0) + mime-types (~> 3.0) multi_xml (>= 0.5.2) - json (1.8.6) + mime-types (3.3.1) + mime-types-data (~> 3.2015) + mime-types-data (3.2019.1009) multi_xml (0.6.0) - rspec (2.5.0) - rspec-core (~> 2.5.0) - rspec-expectations (~> 2.5.0) - rspec-mocks (~> 2.5.0) - rspec-core (2.5.1) - rspec-expectations (2.5.0) - diff-lcs (~> 1.1.2) - rspec-mocks (2.5.0) + rspec (3.9.0) + rspec-core (~> 3.9.0) + rspec-expectations (~> 3.9.0) + rspec-mocks (~> 3.9.0) + rspec-core (3.9.1) + rspec-support (~> 3.9.1) + rspec-expectations (3.9.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.9.0) + rspec-mocks (3.9.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.9.0) + rspec-support (3.9.2) safe_yaml (1.0.5) PLATFORMS @@ -37,4 +44,4 @@ DEPENDENCIES ruby-pardot! BUNDLED WITH - 2.0.2 + 2.1.4 diff --git a/lib/pardot/objects/emails.rb b/lib/pardot/objects/emails.rb index f3ffe69..a49d861 100644 --- a/lib/pardot/objects/emails.rb +++ b/lib/pardot/objects/emails.rb @@ -21,6 +21,10 @@ def send_to_prospect prospect_id, params post "/do/send/prospect_id/#{prospect_id}", params end + def send_to_prospect_email prospect_email, params + post "/do/send/prospect_email/#{prospect_email}", params + end + def send_to_list params post "/do/send", params end diff --git a/ruby-pardot.gemspec b/ruby-pardot.gemspec index 4e46b42..b271362 100644 --- a/ruby-pardot.gemspec +++ b/ruby-pardot.gemspec @@ -15,7 +15,7 @@ Gem::Specification.new do |s| s.rubyforge_project = "ruby-pardot" s.add_dependency "crack", "0.4.3" - s.add_dependency "httparty", "0.13.1" + s.add_dependency "httparty", "0.18.0" s.add_development_dependency "bundler", ">= 1.10" s.add_development_dependency "rspec" diff --git a/spec/pardot/objects/emails_spec.rb b/spec/pardot/objects/emails_spec.rb index d16391b..3c08b2d 100644 --- a/spec/pardot/objects/emails_spec.rb +++ b/spec/pardot/objects/emails_spec.rb @@ -30,6 +30,12 @@ def sample_response assert_authorization_header end + it 'should send to a prospect email' do + fake_post '/api/email/version/3/do/send/prospect_email/test@email.com?campaign_id=765&email_template_id=86&format=simple', sample_response + @client.emails.send_to_prospect_email('test@email.com', :campaign_id => 765, :email_template_id => 86).should == {"name" => "My Email"} + assert_authorization_header + end + it 'should send to a list' do fake_post '/api/email/version/3/do/send?email_template_id=200&list_ids[]=235&campaign_id=654&format=simple', sample_response @client.emails.send_to_list(:email_template_id => 200, 'list_ids[]' => 235, :campaign_id => 654).should == {"name" => "My Email"}