mailblastr 5.0.1 → 5.1.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 +2 -0
- data/lib/mailblastr/contacts.rb +16 -4
- data/lib/mailblastr/emails.rb +1 -1
- data/lib/mailblastr/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: a028b42e26c044b29d184717824743d50dc909638a11f26182373c29f39a801e
|
|
4
|
+
data.tar.gz: 9bc74f8a2d2dd6b8c795bde5c92e6fa3490e9e9aa4fe14ff87cca1d3ca3fe710
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e9c966eea358f8d09c5f2087a7f209e9d78d642ccdff1a8e8a38b510ed0df4b32074474cfa06d8b4dc14743af868878f837d249be2303c3c53b017ebb8f3c236
|
|
7
|
+
data.tar.gz: '082c972bf7ed332f0b6b1ae5d851718ec0dab54c9ca2b9746da27047cb263bd19640a03b77f3ee7de18b618fde84d00adbeae9b8fa0936536b065c97c7c1a367'
|
data/README.md
CHANGED
|
@@ -182,6 +182,8 @@ Mailblastr::Contacts.list({ audience_id: aud_id, segment_id: seg_id })
|
|
|
182
182
|
|
|
183
183
|
# Bulk import
|
|
184
184
|
Mailblastr::Contacts.batch({ audience_id: aud_id, contacts: [{ email: "a@b.com" }], on_conflict: "skip" })
|
|
185
|
+
# Domain-first: import straight into a domain's pool, no audience id needed.
|
|
186
|
+
Mailblastr::Contacts.batch({ domain: "yourdomain.com", contacts: [{ email: "a@b.com" }] })
|
|
185
187
|
Mailblastr::Contacts.import({ audience_id: aud_id, csv: "email,company\na@b.com,Acme" })
|
|
186
188
|
|
|
187
189
|
# CSV too big to inline (5 MB / 10,000 rows)? Upload it directly, then import by key.
|
data/lib/mailblastr/contacts.rb
CHANGED
|
@@ -81,19 +81,31 @@ module Mailblastr
|
|
|
81
81
|
end
|
|
82
82
|
|
|
83
83
|
# Bulk-import contacts from an array (upsert by email; max 10,000).
|
|
84
|
-
#
|
|
84
|
+
#
|
|
85
|
+
# Domain-first, like .create: pass :domain for the flat
|
|
86
|
+
# POST /contacts/batch, or :audience_id for POST /audiences/:id/contacts/batch.
|
|
87
|
+
# Prefer this over a .create loop for many contacts — one batch takes the
|
|
88
|
+
# account's contact-limit lock once, a loop takes it per contact.
|
|
89
|
+
# Contacts.batch({ domain: "yourdomain.com", contacts: [{ email: "a@b.com" }] })
|
|
85
90
|
# Contacts.batch({ audience_id: "aud_1", contacts: [{ email: "a@b.com" }], on_conflict: "skip" })
|
|
86
91
|
def batch(params)
|
|
87
92
|
audience_id = Client.opt(params, :audience_id)
|
|
88
93
|
query = {}
|
|
89
94
|
on_conflict = Client.opt(params, :on_conflict)
|
|
90
95
|
query[:on_conflict] = on_conflict if on_conflict
|
|
91
|
-
Client.
|
|
96
|
+
body = { contacts: Client.opt(params, :contacts) }
|
|
97
|
+
return Client.request(
|
|
92
98
|
:post,
|
|
93
99
|
"/audiences/#{Client.path_escape(audience_id)}/contacts/batch",
|
|
94
|
-
body:
|
|
100
|
+
body: body,
|
|
95
101
|
query: query
|
|
96
|
-
)
|
|
102
|
+
) if audience_id
|
|
103
|
+
|
|
104
|
+
# The nested route derives its pool from the path; only the flat route
|
|
105
|
+
# takes :domain (in the body, same as POST /contacts).
|
|
106
|
+
domain = Client.opt(params, :domain)
|
|
107
|
+
body[:domain] = domain unless domain.nil?
|
|
108
|
+
Client.request(:post, "/contacts/batch", body: body, query: query)
|
|
97
109
|
end
|
|
98
110
|
|
|
99
111
|
# Bulk-import contacts from CSV (header row optional; upsert by email).
|
data/lib/mailblastr/emails.rb
CHANGED
|
@@ -33,7 +33,7 @@ module Mailblastr
|
|
|
33
33
|
# `search` is absent. GET /emails
|
|
34
34
|
def list(params = {})
|
|
35
35
|
query = Client.pagination(params).merge(
|
|
36
|
-
Client.filters(params, :campaign_id, :automation_id, :source, :domain_id, :status, :search, :q)
|
|
36
|
+
Client.filters(params, :campaign_id, :automation_id, :source, :domain_id, :status, :search, :q, :folder)
|
|
37
37
|
)
|
|
38
38
|
Client.request(:get, "/emails", query: query)
|
|
39
39
|
end
|
data/lib/mailblastr/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mailblastr
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.0
|
|
4
|
+
version: 5.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- MailBlastr
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-08-
|
|
11
|
+
date: 2026-08-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: minitest
|