millionsend 0.7.0 → 0.8.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 +4 -4
- data/README.md +5 -2
- data/lib/millionsend/contacts.rb +10 -4
- data/lib/millionsend/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e916d31911bcbb75dc0c6aae5f671a2034a6aff4eac3f0b9be4e9eaa58b5c747
|
|
4
|
+
data.tar.gz: ba3d5063d02bd243660dfe04dee0780a84b2bad05cd11cd2c2690f3ffcfeca2a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5c5d558bf5d08c705e8ae11ba6a6ed5e7cf6220a9629eb5a83bcc5570a713e669b5a7718b6d0f10b8bef00c5bf730d1e89599f6072948d76931cffe675b1d46c
|
|
7
|
+
data.tar.gz: 65edabd5b84e8f224045a7ebaab207f962221a75aab27ca32330435bee190a15834c45a06c7fcaeeeda1a77c46c305be4a314304d256968657d4c1886ad12ef3
|
data/README.md
CHANGED
|
@@ -121,7 +121,9 @@ contact = Millionsend::Contacts.create(
|
|
|
121
121
|
)
|
|
122
122
|
Millionsend::Contacts.get("ada@acme.dev") # by id or email; also resend-ruby's get(id: ...) / get(email: ...)
|
|
123
123
|
Millionsend::Contacts.update(id: contact[:id], unsubscribed: true, first_name: nil) # nil clears
|
|
124
|
-
Millionsend::Contacts.remove("ada@acme.dev")
|
|
124
|
+
Millionsend::Contacts.remove("ada@acme.dev") # the contact's emails stay in the send log
|
|
125
|
+
Millionsend::Contacts.remove("ada@acme.dev", erase: true) # ?erase=true — also scrubs the address from email
|
|
126
|
+
# history, event payloads and API logs (GDPR/LGPD)
|
|
125
127
|
Millionsend::Contacts.list(limit: 50)
|
|
126
128
|
# Bulk read (MillionSend extension): carry the property map and the topic subscriptions on every
|
|
127
129
|
# item, so an audience reads in one request per 100 contacts instead of one per contact
|
|
@@ -159,7 +161,8 @@ found[:data] # [{ object: "contact", id:, email:, first_name:, last_name:, cr
|
|
|
159
161
|
found[:missing] # [{ index:, email: }] / [{ index:, id: }] — request entries that matched nobody
|
|
160
162
|
|
|
161
163
|
# Bulk delete (MillionSend extension) — up to 1000 per call, exactly one of ids: / emails:
|
|
162
|
-
Millionsend::Contacts::Batch.remove(emails: ["a@acme.dev", "b@acme.dev"]) # or ids: [...]
|
|
164
|
+
Millionsend::Contacts::Batch.remove(emails: ["a@acme.dev", "b@acme.dev"]) # or ids: [...]; emails stay in the log
|
|
165
|
+
Millionsend::Contacts::Batch.remove(ids: [contact[:id]], erase: true) # also scrubs each address, as Contacts.remove
|
|
163
166
|
# => { data: [{ object: "contact", contact: "<uuid>", deleted: true }, ...] } — only the rows actually deleted
|
|
164
167
|
```
|
|
165
168
|
|
data/lib/millionsend/contacts.rb
CHANGED
|
@@ -24,9 +24,13 @@ module Millionsend
|
|
|
24
24
|
Millionsend::Request.new(method: :patch, path: member_path(params), body: body).perform
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
-
# DELETE a contact by id or email.
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
# DELETE a contact by id or email. The contact's emails stay in the send
|
|
28
|
+
# log; erase: true also scrubs the address from email history, event
|
|
29
|
+
# payloads and API logs (a GDPR/LGPD erasure). The flag rides flat or in
|
|
30
|
+
# resend-ruby's addressing hash: remove(email: "a@x.dev", erase: true).
|
|
31
|
+
def remove(id_or_email, options = {})
|
|
32
|
+
erase = options.key?(:erase) ? options[:erase] : (id_or_email[:erase] if id_or_email.is_a?(Hash))
|
|
33
|
+
Millionsend::Request.new(method: :delete, path: member_path(id_or_email), query: { erase: erase }).perform
|
|
30
34
|
end
|
|
31
35
|
|
|
32
36
|
# GET /contacts — accepts limit:/after:/before: and include:
|
|
@@ -121,7 +125,9 @@ module Millionsend
|
|
|
121
125
|
end
|
|
122
126
|
|
|
123
127
|
# POST /contacts/batch/remove — { ids: [...] } or { emails: [...] }
|
|
124
|
-
# (exactly one, up to 1000)
|
|
128
|
+
# (exactly one, up to 1000), plus erase: true to also scrub each
|
|
129
|
+
# address from email history, event payloads and API logs, as
|
|
130
|
+
# Contacts.remove does. Returns { data: [{ object:, contact:,
|
|
125
131
|
# deleted: true }] } listing only the rows actually deleted; unknown
|
|
126
132
|
# ids or addresses are skipped.
|
|
127
133
|
def remove(params)
|
data/lib/millionsend/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: millionsend
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.8.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- MillionSend
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-09-
|
|
11
|
+
date: 2026-09-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|