unitpost 0.1.0 → 0.2.1

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: fffb836d80d04f7e9a1fc9491451022bdd6f6349aceb18751b5bb8963c02db76
4
- data.tar.gz: 1265d40f0d6c6da34a464f402eb54d12f02261459cd286d8980cc9cbae4907f4
3
+ metadata.gz: e92552a542bfa040de967b8d88af9aba31d6edbd0001768633793263a0728bc2
4
+ data.tar.gz: 7b49579c2d34abdb8efb2d9b01382edb1b1f646467b1c7fe33573c65ce89176a
5
5
  SHA512:
6
- metadata.gz: 6f785497b63324e0398ea4d0c9e4c087b695c9c4bd59669722e2a8e340084837e480cbaf783b9b96b903f1ff44cf6cfcc689dd94da6ece8508233182e3c9decc
7
- data.tar.gz: 4e4c44b15c5f38125a5c9206be4f55a6eac770ea1a594be4fd4f9bf80b1a665df09bda598101bed833c643179ab69acb9b2ae48f83054f9bd03b0e10df2cd384
6
+ metadata.gz: f35532690b25c113997d1b594db3bf849dc4f60853f2c290eadb95940958b3c5084c59ef71320486728a9a97f666b21a1541599a972edc5e670a609dc640fddf
7
+ data.tar.gz: d8d884f80928d12d3023886986c641de6221886a1b0bcde7ab9005a9971f48257aa8df58e8bc7ea5126d3213231dd08cb7ef6dbd41312489bf07127f08b947b9
data/README.md CHANGED
@@ -24,7 +24,7 @@ require "unitpost"
24
24
 
25
25
  unitpost = Unitpost::Client.new # reads UNITPOST_API_KEY (or pass api_key:)
26
26
 
27
- result = unitpost.emails.send({
27
+ result = unitpost.email.send({
28
28
  from: "Acme <you@yourdomain.com>", # bare address works too
29
29
  to: "customer@example.com",
30
30
  subject: "Hello",
@@ -117,8 +117,8 @@ pass `idempotency_key:`, the SDK generates one so an automatic retry can't
117
117
  double-send. Pass your own to dedupe across separate calls:
118
118
 
119
119
  ```ruby
120
- unitpost.emails.send({ ... }, idempotency_key: SecureRandom.uuid)
121
- unitpost.emails.batch([ ... ], idempotency_key: SecureRandom.uuid)
120
+ unitpost.email.send({ ... }, idempotency_key: SecureRandom.uuid)
121
+ unitpost.email.batch([ ... ], idempotency_key: SecureRandom.uuid)
122
122
  ```
123
123
 
124
124
  > The server dedupes on `(workspace, idempotency key)` for 24h and replays the
@@ -8,15 +8,15 @@ module Unitpost
8
8
  #
9
9
  # require "unitpost"
10
10
  # unitpost = Unitpost::Client.new # reads UNITPOST_API_KEY
11
- # result = unitpost.emails.send(from: ..., to: ..., subject: ..., html: ...)
11
+ # result = unitpost.email.send(from: ..., to: ..., subject: ..., html: ...)
12
12
  # if result.error
13
13
  # warn "#{result.error.code}: #{result.error.message}"
14
14
  # else
15
15
  # puts result.data["id"]
16
16
  # end
17
17
  class Client
18
- attr_reader :emails, :contacts, :contact_fields, :segments, :topics,
19
- :campaigns, :templates, :brand_kits, :domains, :webhooks, :api_keys, :suppressions,
18
+ attr_reader :email, :contacts, :contact_fields, :segments,
19
+ :brand_kits, :webhooks, :api_keys, :suppressions,
20
20
  :usage
21
21
 
22
22
  def initialize(api_key: nil, base_url: nil, timeout: 30, headers: {}, adapter: nil, stubs: nil,
@@ -33,15 +33,11 @@ module Unitpost
33
33
  max_retry_delay: max_retry_delay,
34
34
  sleeper: sleeper
35
35
  )
36
- @emails = Resources::Emails.new(http)
36
+ @email = Resources::Email.new(http)
37
37
  @contacts = Resources::Contacts.new(http)
38
38
  @contact_fields = Resources::ContactFields.new(http)
39
39
  @segments = Resources::Segments.new(http)
40
- @topics = Resources::Topics.new(http)
41
- @campaigns = Resources::Campaigns.new(http)
42
- @templates = Resources::Templates.new(http)
43
40
  @brand_kits = Resources::BrandKits.new(http)
44
- @domains = Resources::Domains.new(http)
45
41
  @webhooks = Resources::Webhooks.new(http)
46
42
  @api_keys = Resources::ApiKeys.new(http)
47
43
  @suppressions = Resources::Suppressions.new(http)