From 5732629eafb0931b29b8bd10d43a0cbb2b3abff9 Mon Sep 17 00:00:00 2001 From: Austin Vance Date: Tue, 18 Feb 2020 16:19:25 -0600 Subject: [PATCH 1/2] Add ability to send email via prospect email Co-authored-by: james mcmahon --- lib/pardot/objects/emails.rb | 4 ++++ spec/pardot/objects/emails_spec.rb | 6 ++++++ 2 files changed, 10 insertions(+) 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/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"} From f382d43d452f8d96fd6b77149d48f328201fca62 Mon Sep 17 00:00:00 2001 From: Christopher Serpico Date: Wed, 8 Apr 2020 13:47:30 -0500 Subject: [PATCH 2/2] Upgrading HTTParty to the latest version --- Gemfile.lock | 35 +++++++++++++++++++++-------------- ruby-pardot.gemspec | 2 +- 2 files changed, 22 insertions(+), 15 deletions(-) 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/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"