mailblastr 2.0.0 → 3.0.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 -5
- data/lib/mailblastr/contacts.rb +2 -2
- data/lib/mailblastr/emails.rb +2 -2
- data/lib/mailblastr/version.rb +1 -1
- data/lib/mailblastr/webhooks.rb +2 -2
- 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: e9210b14443861405563bc567facbbdbbc1f2a085ed6758d67ba9d1e070ef65a
|
|
4
|
+
data.tar.gz: faa999d54c513582c1e708b9b388e12a02d5df3b4ff1cc9102a6a22788e15541
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bb7228f34d402024c01ac0352d83a8a67b8f68f40720157fd635775fb19d5d3ae83d5f926bff9de4e4a7994fe8a9c48bbdeaa64c899ec2beae0a227a5c6ebc7b
|
|
7
|
+
data.tar.gz: b84a3d5deb93b3c34fa0bb1fa3e6a69137bdfc4bf21e47e3fa3864481e00a7fd6782d5e1baab60b6f4d2629fce749508aec0d025632450a44fa27969f1b70c57
|
data/README.md
CHANGED
|
@@ -129,11 +129,11 @@ Mailblastr::Emails.send({
|
|
|
129
129
|
|
|
130
130
|
```ruby
|
|
131
131
|
Mailblastr::Emails::Receiving.list
|
|
132
|
-
Mailblastr::Emails::Receiving.
|
|
132
|
+
Mailblastr::Emails::Receiving.list_addresses # per-address inbound stats
|
|
133
133
|
Mailblastr::Emails::Receiving.get(id)
|
|
134
134
|
Mailblastr::Emails::Receiving.list_attachments(id)
|
|
135
135
|
Mailblastr::Emails::Receiving.get_attachment(id, attachment_id) # => raw bytes (String)
|
|
136
|
-
Mailblastr::Emails::Receiving.
|
|
136
|
+
Mailblastr::Emails::Receiving.get_raw(id) # => original RFC822 message
|
|
137
137
|
Mailblastr::Emails::Receiving.forward(id, { from: "you@yourdomain.com", to: "team@you.com" })
|
|
138
138
|
Mailblastr::Emails::Receiving.reply(id, { from: "you@yourdomain.com", html: "<p>Thanks!</p>" })
|
|
139
139
|
Mailblastr::Emails::Receiving.delete(id)
|
|
@@ -182,7 +182,7 @@ Mailblastr::Contacts.batch({ audience_id: aud_id, contacts: [{ email: "a@b.com"
|
|
|
182
182
|
Mailblastr::Contacts.import({ audience_id: aud_id, csv: "email,company\na@b.com,Acme" })
|
|
183
183
|
|
|
184
184
|
# CSV too big to inline (5 MB / 10,000 rows)? Upload it directly, then import by key.
|
|
185
|
-
slot = Mailblastr::Contacts.
|
|
185
|
+
slot = Mailblastr::Contacts.create_import_upload({ audience_id: aud_id, filename: "list.csv", size: bytes })
|
|
186
186
|
# PUT the file to slot["upload_url"], then:
|
|
187
187
|
Mailblastr::Contacts.import({ audience_id: aud_id, storage_key: slot["storage_key"] })
|
|
188
188
|
|
|
@@ -330,10 +330,10 @@ warn "test delivery failed: #{result['error']}" unless result["ok"]
|
|
|
330
330
|
|
|
331
331
|
### Verifying deliveries
|
|
332
332
|
|
|
333
|
-
`
|
|
333
|
+
`verify` checks the Svix-style HMAC-SHA256 signature locally (no HTTP request). Pass the **exact raw request body** — re-serializing parsed JSON breaks the signature.
|
|
334
334
|
|
|
335
335
|
```ruby
|
|
336
|
-
result = Mailblastr::Webhooks.
|
|
336
|
+
result = Mailblastr::Webhooks.verify(
|
|
337
337
|
request.raw_post, # raw body string
|
|
338
338
|
{
|
|
339
339
|
"svix-id" => request.headers["svix-id"],
|
data/lib/mailblastr/contacts.rb
CHANGED
|
@@ -104,7 +104,7 @@ module Mailblastr
|
|
|
104
104
|
#
|
|
105
105
|
# Inline CSV text (capped at 5 MB and 10,000 rows):
|
|
106
106
|
# Contacts.import({ audience_id: "aud_1", csv: "email\na@b.com" })
|
|
107
|
-
# Or a file already uploaded via
|
|
107
|
+
# Or a file already uploaded via create_import_upload (no row cap — the
|
|
108
108
|
# overflow past your contact limit comes back as `limit_skipped`):
|
|
109
109
|
# Contacts.import({ audience_id: "aud_1", storage_key: key })
|
|
110
110
|
def import(params)
|
|
@@ -125,7 +125,7 @@ module Mailblastr
|
|
|
125
125
|
# `storage_key` to Contacts.import.
|
|
126
126
|
# POST /audiences/:id/contacts/import/upload — params: { filename:, size: }
|
|
127
127
|
# The `upload_url` is a bearer credential — do not log it.
|
|
128
|
-
def
|
|
128
|
+
def create_import_upload(params)
|
|
129
129
|
audience_id = Client.opt(params, :audience_id)
|
|
130
130
|
Client.request(
|
|
131
131
|
:post,
|
data/lib/mailblastr/emails.rb
CHANGED
|
@@ -79,7 +79,7 @@ module Mailblastr
|
|
|
79
79
|
|
|
80
80
|
# Per-address inbound stats (totals, replies, last received).
|
|
81
81
|
# Not paginated. GET /emails/receiving/addresses
|
|
82
|
-
def
|
|
82
|
+
def list_addresses
|
|
83
83
|
Client.request(:get, "/emails/receiving/addresses")
|
|
84
84
|
end
|
|
85
85
|
|
|
@@ -111,7 +111,7 @@ module Mailblastr
|
|
|
111
111
|
|
|
112
112
|
# Download the original RFC822/MIME message as raw bytes (binary String).
|
|
113
113
|
# GET /emails/receiving/:id/raw
|
|
114
|
-
def
|
|
114
|
+
def get_raw(email_id)
|
|
115
115
|
Client.request(:get, "/emails/receiving/#{Client.path_escape(email_id)}/raw", raw: true)
|
|
116
116
|
end
|
|
117
117
|
|
data/lib/mailblastr/version.rb
CHANGED
data/lib/mailblastr/webhooks.rb
CHANGED
|
@@ -70,9 +70,9 @@ module Mailblastr
|
|
|
70
70
|
#
|
|
71
71
|
# Returns { valid: true } or { valid: false, reason: "..." }.
|
|
72
72
|
#
|
|
73
|
-
# result = Mailblastr::Webhooks.
|
|
73
|
+
# result = Mailblastr::Webhooks.verify(request.raw_post, request.headers.to_h, secret)
|
|
74
74
|
# head :unauthorized unless result[:valid]
|
|
75
|
-
def
|
|
75
|
+
def verify(payload, headers, secret, tolerance: 300)
|
|
76
76
|
id = read_header(headers, "svix-id")
|
|
77
77
|
timestamp = read_header(headers, "svix-timestamp")
|
|
78
78
|
sig_header = read_header(headers, "svix-signature")
|
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:
|
|
4
|
+
version: 3.0.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-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: minitest
|