maropost 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9c8115f30902b993b7c8d6895006ec6a69cbe84a
4
- data.tar.gz: 2fa10ba47d14f3abe08caefb7c48adb6220a0ae5
3
+ metadata.gz: 39e6f1d4da90fa3c4c9892b6b6f3b61e3e1d1a6c
4
+ data.tar.gz: c897b70a3579757098f9e9d454bff2b892e38b04
5
5
  SHA512:
6
- metadata.gz: 6484c0511c8216ebc583d9fa4b3baaa0c67c5cd6ddd64384f660a38fa472bd1b9559db1dcb697b3663de5f3c789cf5eeca7e71bf79377d096563c866174dd5c2
7
- data.tar.gz: f6623d5bf9b6a974850d5ba9c2a2486c197c3504b5a4b39d9868e31d2861abbdf8f0705cdb51f02d56ac8662b19e5cacf343e069e3df2bdf5c636a578dbb909b
6
+ metadata.gz: 1ed92b4f9101bedef107aa8208ea13abc5e0c8598cef2b1ec96f91dceae4cc691970e23874d6d063fddc5bd892bd0edcda019ee82c1c7d0f85a547b46388b371
7
+ data.tar.gz: 7c5e53edfce997062836955401cc26e9d0c869a86974d7da5b67836016e0edbd4e03dbfb2c5470872082e518d8a2fe68852b021197f5fc42b190745a95971a78
data/lib/maropost/api.rb CHANGED
@@ -2,7 +2,7 @@ module Maropost
2
2
  class Api
3
3
  def self.find(email)
4
4
  response = request(:get,
5
- maropost_url('/contacts/email.json', "contact[email]=#{email}"))
5
+ maropost_url('contacts/email.json', "contact[email]=#{email}"))
6
6
  Maropost::Contact.new(JSON.parse response.body)
7
7
  rescue RestClient::ResourceNotFound
8
8
  nil
@@ -20,7 +20,7 @@ module Maropost
20
20
 
21
21
  def self.create(contact)
22
22
  response = request(:post,
23
- maropost_url('/contacts.json'),
23
+ maropost_url('contacts.json'),
24
24
  create_or_update_payload(contact))
25
25
  Maropost::Contact.new(JSON.parse response.body)
26
26
  rescue RestClient::UnprocessableEntity, RestClient::BadRequest => e
@@ -30,7 +30,7 @@ module Maropost
30
30
 
31
31
  def self.update(contact)
32
32
  response = request(:put,
33
- maropost_url("/contacts/#{contact.id}.json"),
33
+ maropost_url("contacts/#{contact.id}.json"),
34
34
  create_or_update_payload(contact))
35
35
  Maropost::Contact.new(JSON.parse response.body)
36
36
  rescue RestClient::UnprocessableEntity, RestClient::BadRequest => e
@@ -2,7 +2,7 @@ module Maropost
2
2
  class DoNotMailList
3
3
  def self.exists?(contact)
4
4
  response = request(:get,
5
- maropost_url('/global_unsubscribes/email.json', "contact[email]=#{contact.email}"))
5
+ maropost_url('global_unsubscribes/email.json', "contact[email]=#{contact.email}"))
6
6
  JSON.parse response.body
7
7
 
8
8
  response['id'] ? true : false
@@ -15,7 +15,7 @@ module Maropost
15
15
  payload = { 'global_unsubscribe': { 'email': contact.email } }
16
16
 
17
17
  request(:post,
18
- maropost_url('/global_unsubscribes.json'),
18
+ maropost_url('global_unsubscribes.json'),
19
19
  payload)
20
20
  contact
21
21
  rescue RestClient::UnprocessableEntity, RestClient::BadRequest => e
@@ -25,7 +25,7 @@ module Maropost
25
25
 
26
26
  def self.delete(contact)
27
27
  request(:delete,
28
- maropost_url('/global_unsubscribes/delete.json', "email=#{contact.email}"))
28
+ maropost_url('global_unsubscribes/delete.json', "email=#{contact.email}"))
29
29
  contact
30
30
  rescue RestClient::UnprocessableEntity, RestClient::BadRequest => e
31
31
  contact.errors << "Unable to unsubscribe contact. Error: #{e.message}"
@@ -1,3 +1,3 @@
1
1
  module Maropost
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maropost
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael van den Beuken