mailkite 0.15.0 → 0.17.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailkite.rb +36 -1
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 61dc819f47489094c0383f6dadd09c9e44b271111e102a4bb812df363d8924e3
4
- data.tar.gz: da5d0c39a68aaefa3c68772e7eef2a902ff330c87fe9963cc9003700e2e6da84
3
+ metadata.gz: b15ee263fe07ec0ace5a924dfbf72ea4af0315ec1d3e680c6de957fbabc9f802
4
+ data.tar.gz: 736c9345872755f6d696347f39131e103f4a1bb0a6620fa0ef0066061090751d
5
5
  SHA512:
6
- metadata.gz: 37b93a71c54436409beb8d091d9e03f496fee22a3859425f23b49bf9cc89219a2269e061b74f9bc667c67bb070559c4a9e018bb6874845c2a7e855e696e6c6b5
7
- data.tar.gz: 76b3c98d2e1704c8379c45df028c1c83207ca4891b0c4ad552ce87ef09688fae6c22cdc5be2dd445d7050e86345b6fb5c78a216574d9d3f5980557765b12a634
6
+ metadata.gz: 7f6115ce30631c431bb1f4f7eb009f21418930108ad237c318cc33ff753edb0751a1fdb8ff424f8d4f06d2340a7657e5bc3570295d71cca9907e62ed578964c8
7
+ data.tar.gz: 9bc55eac84d0f2f62ebc8630e14bba0a9a095ec083c1010ee8c111fcc842d3b6d1620f6bdeb6aaaec385c63a3b8c354ddae15ded8581ab71af6eb8cb0078b1e7
data/lib/mailkite.rb CHANGED
@@ -15,7 +15,7 @@ require "base64"
15
15
  require "cgi"
16
16
 
17
17
  module Mailkite
18
- VERSION = "0.15.0"
18
+ VERSION = "0.17.0"
19
19
  DEFAULT_BASE_URL = "https://api.mailkite.dev"
20
20
  # Reject webhook events older than this (ms) to block replays. Pass 0 to disable.
21
21
  DEFAULT_TOLERANCE_MS = 5 * 60 * 1000
@@ -214,10 +214,29 @@ module Mailkite
214
214
  # message keys: from, to, text/html, etc. `subject` is optional when a
215
215
  # template supplies it. Pass `templateId` to render a stored template and
216
216
  # `templateData` (a hash) to fill its variables.
217
+ # Send an email. +message+ is a hash with "from", "to" and a body ("text"
218
+ # and/or "html"). Also accepted: "subject" (optional when a template
219
+ # supplies it), "cc"/"bcc" (string or array), "replyTo", "inReplyTo"
220
+ # (thread a reply), "attachments" (array of {filename, url|content,
221
+ # contentType}), "headers" (hash of extra raw MIME headers, e.g.
222
+ # List-Unsubscribe — immediate sends only), and "templateId" +
223
+ # "templateData" to render a stored template.
217
224
  def send(message)
218
225
  request("POST", "/v1/send", message)
219
226
  end
220
227
 
228
+ # Send one personalized message per recipient (up to 50) in a single call.
229
+ # +batch+ is a hash with "from" and "recipients" (array of {"to",
230
+ # "templateData", "headers"} — exactly one address each). Shared fields
231
+ # ("subject", "html"/"text", "templateId", "templateData", "headers", …)
232
+ # form the base message; per-recipient "templateData" and "headers" are
233
+ # merged over the shared ones (the recipient wins). Every message passes
234
+ # the same gates as send() and gets its own id — the response reports each
235
+ # recipient's outcome in order, so a batch can partially succeed.
236
+ def sendBatch(batch)
237
+ request("POST", "/v1/send/batch", batch)
238
+ end
239
+
221
240
  # Extension → MIME map for raw-binary attachment uploads (default
222
241
  # application/octet-stream when an extension is unknown).
223
242
  ATTACHMENT_MIME = {
@@ -332,6 +351,22 @@ module Mailkite
332
351
  request("DELETE", "/api/domains/#{id}/webhook")
333
352
  end
334
353
 
354
+ def setTrackingWebhook(id, body)
355
+ request("PUT", "/api/domains/#{id}/tracking-webhook", body)
356
+ end
357
+
358
+ def deleteTrackingWebhook(id)
359
+ request("DELETE", "/api/domains/#{id}/tracking-webhook")
360
+ end
361
+
362
+ def setWebhookEvents(id, body)
363
+ request("PUT", "/api/domains/#{id}/webhook-events", body)
364
+ end
365
+
366
+ def deleteWebhookEvents(id)
367
+ request("DELETE", "/api/domains/#{id}/webhook-events")
368
+ end
369
+
335
370
  def testWebhook(id)
336
371
  request("POST", "/api/domains/#{id}/webhook/test")
337
372
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailkite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - MailKite
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-07-05 00:00:00.000000000 Z
11
+ date: 2026-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mail