mailchimp_api 1.1.0 → 1.2.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.
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 91fedcca91cc3d9f0e72a5ab0d1d5286afeac10bfa1d33915f96c01965015127
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 96e0631b7d4bd950dfe3e172b5d449502d4f402fc09f0247e9f5f3984a1186e3
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 6f53ae31678e8efaee3facb81e2e282a43e4a3fbb3504f6affd2ac0240016bece468b6dce520dea6365bf0d94e58114d5c937f51f0595d4cc766bbe647d884b3
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: e813a705ab1954b9091fb3edf369d7bf78ba84c92592bcf8e07b6fb85b0c73595eb596b370bd9b2268fe31898569fbd27ebf783ad1ed82702c6c77fc85481f5b
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    
| 
         @@ -0,0 +1,45 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            module MailchimpAPI
         
     | 
| 
      
 4 
     | 
    
         
            +
              class Campaign < Base
         
     | 
| 
      
 5 
     | 
    
         
            +
                extend MailchimpAPI::Support::Countable
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
                include MailchimpAPI::Support::PatchUpdate
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
                self.collection_parser = CollectionParsers::Campaign
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
                # Define all bodiless, non-RESTful actions
         
     | 
| 
      
 12 
     | 
    
         
            +
                %w[
         
     | 
| 
      
 13 
     | 
    
         
            +
                  cancel-send
         
     | 
| 
      
 14 
     | 
    
         
            +
                  create-resend
         
     | 
| 
      
 15 
     | 
    
         
            +
                  pause
         
     | 
| 
      
 16 
     | 
    
         
            +
                  replicate
         
     | 
| 
      
 17 
     | 
    
         
            +
                  resume
         
     | 
| 
      
 18 
     | 
    
         
            +
                  unschedule
         
     | 
| 
      
 19 
     | 
    
         
            +
                ].each do |path_name|
         
     | 
| 
      
 20 
     | 
    
         
            +
                  define_method path_name.sub('-', '_') do
         
     | 
| 
      
 21 
     | 
    
         
            +
                    path = element_path(prefix_options) + "/actions/#{path_name}"
         
     | 
| 
      
 22 
     | 
    
         
            +
                    connection.post path, nil, self.class.headers
         
     | 
| 
      
 23 
     | 
    
         
            +
                  end
         
     | 
| 
      
 24 
     | 
    
         
            +
                end
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
      
 26 
     | 
    
         
            +
                # Calls the '/send' endpoint, but we obviously can't override the Ruby 'send' method.
         
     | 
| 
      
 27 
     | 
    
         
            +
                def send_campaign
         
     | 
| 
      
 28 
     | 
    
         
            +
                  path = element_path(prefix_options) + '/actions/send'
         
     | 
| 
      
 29 
     | 
    
         
            +
                  connection.post path, nil, self.class.headers
         
     | 
| 
      
 30 
     | 
    
         
            +
                end
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
      
 32 
     | 
    
         
            +
                def schedule(time, use_timewarp = false, batch_delivery = false)
         
     | 
| 
      
 33 
     | 
    
         
            +
                  path = element_path(prefix_options) + '/actions/schedule'
         
     | 
| 
      
 34 
     | 
    
         
            +
                  connection.post path, { schedule_time: time.iso8601, timewarp: use_timewarp, batch_delivery: batch_delivery }.to_json, self.class.headers
         
     | 
| 
      
 35 
     | 
    
         
            +
                end
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
      
 37 
     | 
    
         
            +
                # type: String. 'html' or 'plaintext'
         
     | 
| 
      
 38 
     | 
    
         
            +
                def test(emails = [], type = 'html')
         
     | 
| 
      
 39 
     | 
    
         
            +
                  return unless emails.present?
         
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
                  path = element_path(prefix_options) + '/actions/test'
         
     | 
| 
      
 42 
     | 
    
         
            +
                  connection.post path, { test_emails: emails, send_type: type }.to_json, self.class.headers
         
     | 
| 
      
 43 
     | 
    
         
            +
                end
         
     | 
| 
      
 44 
     | 
    
         
            +
              end
         
     | 
| 
      
 45 
     | 
    
         
            +
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: mailchimp_api
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.2.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - rewind.io
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2019-03- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2019-03-15 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: activeresource
         
     | 
| 
         @@ -192,6 +192,7 @@ files: 
     | 
|
| 
       192 
192 
     | 
    
         
             
            - lib/mailchimp_api.rb
         
     | 
| 
       193 
193 
     | 
    
         
             
            - lib/mailchimp_api/collection_parsers.rb
         
     | 
| 
       194 
194 
     | 
    
         
             
            - lib/mailchimp_api/collection_parsers/base.rb
         
     | 
| 
      
 195 
     | 
    
         
            +
            - lib/mailchimp_api/collection_parsers/campaign.rb
         
     | 
| 
       195 
196 
     | 
    
         
             
            - lib/mailchimp_api/collection_parsers/interest.rb
         
     | 
| 
       196 
197 
     | 
    
         
             
            - lib/mailchimp_api/collection_parsers/interest_category.rb
         
     | 
| 
       197 
198 
     | 
    
         
             
            - lib/mailchimp_api/collection_parsers/link.rb
         
     | 
| 
         @@ -212,6 +213,7 @@ files: 
     | 
|
| 
       212 
213 
     | 
    
         
             
            - lib/mailchimp_api/resources.rb
         
     | 
| 
       213 
214 
     | 
    
         
             
            - lib/mailchimp_api/resources/account_information.rb
         
     | 
| 
       214 
215 
     | 
    
         
             
            - lib/mailchimp_api/resources/base.rb
         
     | 
| 
      
 216 
     | 
    
         
            +
            - lib/mailchimp_api/resources/campaign.rb
         
     | 
| 
       215 
217 
     | 
    
         
             
            - lib/mailchimp_api/resources/interest.rb
         
     | 
| 
       216 
218 
     | 
    
         
             
            - lib/mailchimp_api/resources/interest_category.rb
         
     | 
| 
       217 
219 
     | 
    
         
             
            - lib/mailchimp_api/resources/link.rb
         
     |