mailblastr 1.0.0 → 1.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bace5e9375b668304c40339acea2334895be7f7af3221f628ad4f7fa21762752
4
- data.tar.gz: a68a14501aab6cf50309f0bb0d938dad58a5b4a96b31cb09cb9b5285f63979eb
3
+ metadata.gz: b33c9cbe102716978dacde6713e4cc66e25164cb91b26a0272c1f44dbcd5fab9
4
+ data.tar.gz: cb3b4fa5e7ba5bc85266c6cb0108e6a4a555daaf749963284d6045709ff05536
5
5
  SHA512:
6
- metadata.gz: ac99877d9dc0970341b2c1b16e075dfb1f32832d6f10d6fbc220243ccd02a73597cbda5534f5918b5f28f577a2090b5becfa51f23d2e22e90f901446d76a3d1f
7
- data.tar.gz: 7e0e7c62751f5042054e502964595e6ffbc6f732469dca2076bdb748031449efb0023bc5fbd1ae5d1901a4f2ce0aed999957dc82ea0b4b8d693c6416543d5225
6
+ metadata.gz: 480c2cff7e78425b91e649421aa0ca5f1e883188f29a4fe63b68618f68ed11cee752b7e251a30ed7f720377596af3f40cf68e1b5bf23042ed27999fc3a86e977
7
+ data.tar.gz: 337481b2dbd5dd2b4b788706d302ae028aa823e992804bd7681c42a696c087b479c79370e14a803493e0564a121f68c87560a60ed70e7238124599b839778b45
@@ -4,7 +4,10 @@ module Mailblastr
4
4
  module ApiKeys
5
5
  class << self
6
6
  # Create an API key — the full token is returned only once, here.
7
- # POST /api-keys — params: { name:, permission: "full_access"|"sending_access", domain_id: }
7
+ # POST /api-keys — params: { name:, permission: "full_access"|"sending_access", domain_id:, domain_ids: }
8
+ # domain_ids: scopes the key to one or more domains (works with both
9
+ # permissions); domain_id: is the legacy single-domain form. Providing
10
+ # both is a 422.
8
11
  def create(params)
9
12
  Client.request(:post, "/api-keys", body: params)
10
13
  end
@@ -8,6 +8,10 @@ module Mailblastr
8
8
  # POST /automations
9
9
  # Mailblastr::Automations.create({ name: "Welcome series", domain: "yourdomain.com",
10
10
  # trigger: "contact.created" })
11
+ # The built-in "mailblastr:schedule" trigger fires once at
12
+ # `trigger_config` ({ at: ISO 8601 instant, timezone: IANA name }),
13
+ # enrolling every contact of the domain's pool — `trigger_config` is
14
+ # required with that trigger and not accepted on any other.
11
15
  def create(params)
12
16
  Client.require_domain!(params, "Automations.create")
13
17
  Client.request(:post, "/automations", body: params)
@@ -24,6 +28,8 @@ module Mailblastr
24
28
  end
25
29
 
26
30
  # PATCH /automations/:id — params: { name:, status: "enabled"|"disabled", ... }
31
+ # `trigger_config` ({ at:, timezone: }) updates the "mailblastr:schedule"
32
+ # trigger's schedule (only valid on automations with that trigger).
27
33
  def update(automation_id, params)
28
34
  Client.request(:patch, "/automations/#{Client.path_escape(automation_id)}", body: params)
29
35
  end
@@ -8,6 +8,9 @@ module Mailblastr
8
8
  # POST /campaigns
9
9
  # Mailblastr::Campaigns.create({ domain: "yourdomain.com", from: "you@yourdomain.com",
10
10
  # subject: "Hello", html: "<p>Hi</p>", segment_id: "seg_1" })
11
+ # Optional scheduling params: `schedule_timezone` (IANA zone the schedule +
12
+ # daily batching are evaluated in, e.g. "America/New_York") and
13
+ # `daily_batch_size` (max recipients per batch-day, 1-100000).
11
14
  def create(params)
12
15
  Client.require_domain!(params, "Campaigns.create")
13
16
  Client.request(:post, "/campaigns", body: params)
@@ -23,12 +26,18 @@ module Mailblastr
23
26
  Client.request(:get, "/campaigns", query: Client.pagination(params))
24
27
  end
25
28
 
26
- # PATCH /campaigns/:id
29
+ # PATCH /campaigns/:id (draft campaigns only). Accepts the create-side
30
+ # fields plus `followups` (replace pending follow-ups, [] clears),
31
+ # `list_to` (true/false), `unsubscribe_policy` ("account" | "domain" |
32
+ # "ignore"), `schedule_timezone` (IANA zone; nil clears), and
33
+ # `daily_batch_size` (1-100000; nil clears).
27
34
  def update(campaign_id, params)
28
35
  Client.request(:patch, "/campaigns/#{Client.path_escape(campaign_id)}", body: params)
29
36
  end
30
37
 
31
- # Send now, or schedule with { scheduled_at: "..." }. POST /campaigns/:id/send
38
+ # Send now, or schedule with { scheduled_at: "..." }. An optional
39
+ # `schedule_timezone` (IANA name) is persisted onto the campaign so daily
40
+ # batching evaluates batch-days in that zone. POST /campaigns/:id/send
32
41
  def send(campaign_id, params = {})
33
42
  Client.request(:post, "/campaigns/#{Client.path_escape(campaign_id)}/send", body: params)
34
43
  end
@@ -12,13 +12,22 @@ module Mailblastr
12
12
  end
13
13
 
14
14
  # Send up to 100 emails in one request. POST /emails/batch (alias of Batch.send).
15
+ # Batch items reject `attachments` and `scheduled_at` — send those
16
+ # individually via Emails.send.
15
17
  def batch(payloads, options = {})
16
18
  Client.request(:post, "/emails/batch", body: payloads, options: options)
17
19
  end
18
20
 
19
- # List sent emails (trimmed list items). GET /emails
21
+ # List sent emails (trimmed list items) cursor pagination plus optional
22
+ # server-side `campaign_id`, `automation_id`, `source` ("individual"),
23
+ # and `domain_id` filters. GET /emails
20
24
  def list(params = {})
21
- Client.request(:get, "/emails", query: Client.pagination(params))
25
+ query = Client.pagination(params)
26
+ %i[campaign_id automation_id source domain_id].each do |k|
27
+ v = Client.opt(params, k)
28
+ query[k] = v unless v.nil?
29
+ end
30
+ Client.request(:get, "/emails", query: query)
22
31
  end
23
32
 
24
33
  # Retrieve a sent email and its events. GET /emails/:id
@@ -51,9 +60,14 @@ module Mailblastr
51
60
  # Inbound (received) email.
52
61
  module Receiving
53
62
  class << self
54
- # List received emails. GET /emails/receiving
63
+ # List received emails cursor pagination plus an optional
64
+ # `received_for` filter (only messages received for that address).
65
+ # GET /emails/receiving
55
66
  def list(params = {})
56
- Client.request(:get, "/emails/receiving", query: Client.pagination(params))
67
+ query = Client.pagination(params)
68
+ received_for = Client.opt(params, :received_for)
69
+ query[:received_for] = received_for unless received_for.nil?
70
+ Client.request(:get, "/emails/receiving", query: query)
57
71
  end
58
72
 
59
73
  # Retrieve a received email. GET /emails/receiving/:id
@@ -103,6 +117,8 @@ module Mailblastr
103
117
  end
104
118
 
105
119
  # Batch send — Mailblastr::Batch.send([...]). POST /emails/batch
120
+ # Batch items reject `attachments` and `scheduled_at` — send those
121
+ # individually via Mailblastr::Emails.send.
106
122
  module Batch
107
123
  class << self
108
124
  def send(payloads, options = {})
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mailblastr
4
- VERSION = "1.0.0"
4
+ VERSION = "1.2.0"
5
5
  end
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: 1.0.0
4
+ version: 1.2.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-07-24 00:00:00.000000000 Z
11
+ date: 2026-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest