sendkit 1.0.2 → 1.0.6

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: 0106c999a495842413454f3f1594a01d272371a2adad608bc7cf0c24591b6258
4
- data.tar.gz: be2ec7d31c199f30eba834ef615a735a96c883f73a62d154887ce38707b82ab2
3
+ metadata.gz: 0e36634210726e813a947d472b1e5bb2c696dc6efdfae13824007fe4413cb268
4
+ data.tar.gz: b274549c6209f85ee8e82e53cb67015793b66d35ba3261f9c2ecefffb2a1b626
5
5
  SHA512:
6
- metadata.gz: 9d4260be77f6cb3f26be40a4544959ceea1417ade28fe56429066e15507ab00da14c261add1466f0e214a02b2acb84e077d13d5a0d4be490698cb99faffe6e0c
7
- data.tar.gz: c9ce02a5b47fa6d8326d8dfbff593cbe692e50b326a78275b52e8397c4b1391c1bb51ead97f9076ceb8bdde4bb127378b1d67924b4b685f25e4539c54047e2e2
6
+ metadata.gz: f20425271be0f7f41886e130a9510b191a953f6b75e0bb28a152633567541b91f91535501a6111f904267d56382c80b8c5901440890f98838e4ea6498b1d9fba
7
+ data.tar.gz: aa9450b20ffd3c9de42436e2dd14a181a277d941af2b0bd2be0d7ed0a48ece695cc38c918e6b8dec53303cd72f62f4c385f275c549df0f848f9f7a708a413a2b
@@ -30,12 +30,16 @@ module SendKit
30
30
  http.request(request)
31
31
  end
32
32
 
33
- parsed = JSON.parse(response.body)
33
+ begin
34
+ parsed = JSON.parse(response.body)
35
+ rescue JSON::ParserError
36
+ parsed = {}
37
+ end
34
38
 
35
39
  unless response.is_a?(Net::HTTPSuccess)
36
40
  raise Error.new(
37
41
  parsed["message"] || response.message,
38
- name: parsed["name"] || "application_error",
42
+ name: parsed["name"] || "unknown_error",
39
43
  status_code: response.code.to_i
40
44
  )
41
45
  end
@@ -11,19 +11,25 @@ module SendKit
11
11
  payload = {from: from, to: to, subject: subject}
12
12
  payload[:html] = html if html
13
13
  payload[:text] = text if text
14
- payload[:cc] = cc if cc
15
- payload[:bcc] = bcc if bcc
16
- payload[:reply_to] = reply_to if reply_to
14
+ if cc
15
+ payload[:cc] = cc.is_a?(String) ? [cc] : cc
16
+ end
17
+ if bcc
18
+ payload[:bcc] = bcc.is_a?(String) ? [bcc] : bcc
19
+ end
20
+ if reply_to
21
+ payload[:reply_to] = reply_to.is_a?(String) ? [reply_to] : reply_to
22
+ end
17
23
  payload[:headers] = headers if headers
18
24
  payload[:tags] = tags if tags
19
25
  payload[:scheduled_at] = scheduled_at if scheduled_at
20
26
  payload[:attachments] = attachments if attachments
21
27
 
22
- @client.post("/v1/emails", payload)
28
+ @client.post("/emails", payload)
23
29
  end
24
30
 
25
31
  def send_mime(envelope_from:, envelope_to:, raw_message:)
26
- @client.post("/v1/emails/mime", {
32
+ @client.post("/emails/mime", {
27
33
  envelope_from: envelope_from,
28
34
  envelope_to: envelope_to,
29
35
  raw_message: raw_message
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SendKit
4
- VERSION = "1.0.2"
4
+ VERSION = "1.0.6"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sendkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - SendKit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-02-28 00:00:00.000000000 Z
11
+ date: 2026-03-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Official Ruby SDK for the SendKit email API. Send transactional emails
14
14
  with a simple, zero-dependency client.