openemail 0.0.1 → 0.0.3

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.
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenEmail
4
+ module Resources
5
+ class Sending < Resource
6
+ def list_streams(api_key: nil)
7
+ request(ApiPaths::SENDING_STREAMS, api_key:)
8
+ end
9
+
10
+ def resume_stream(stream, api_key: nil)
11
+ request(fill(ApiPaths::SENDING_STREAM_RESUME, stream:), method: :post, api_key:)
12
+ end
13
+
14
+ def list_dedicated_ips(api_key: nil)
15
+ request(ApiPaths::SENDING_DEDICATED_IPS, api_key:)
16
+ end
17
+
18
+ def get_dedicated_ip(ip, api_key: nil)
19
+ request(fill(ApiPaths::SENDING_DEDICATED_IP, ip:), api_key:)
20
+ end
21
+ end
22
+ end
23
+ end
@@ -81,8 +81,9 @@ module OpenEmail
81
81
  body: payload(body, fields), api_key:)
82
82
  end
83
83
 
84
- def publish(id_or_slug, api_key: nil)
85
- request(fill(ApiPaths::TEMPLATE_VERSIONS, id: id_or_slug), method: :post, repeatable: true, api_key:)
84
+ def publish(id_or_slug, expected_version: nil, api_key: nil)
85
+ request(fill(ApiPaths::TEMPLATE_VERSIONS, id: id_or_slug), method: :post,
86
+ body: expected_version.nil? ? nil : {"expectedVersion" => expected_version}, repeatable: true, api_key:)
86
87
  end
87
88
 
88
89
  def preview(id_or_slug, body = nil, api_key: nil, **fields)
@@ -4,20 +4,23 @@ module OpenEmail
4
4
  module Resources
5
5
  class Threads < Resource
6
6
  def list(folder: nil, query: nil, label_ids: nil, sort: nil, date_from: nil, date_to: nil, from_contacts: nil,
7
- limit: nil, cursor: nil, api_key: nil)
8
- fetch_page(ApiPaths::THREADS, list_query(folder, query, label_ids, sort, date_from, date_to, from_contacts),
7
+ semantic: nil, category: nil, address: nil, limit: nil, cursor: nil, api_key: nil)
8
+ fetch_page(ApiPaths::THREADS,
9
+ list_query(folder, query, label_ids, sort, date_from, date_to, from_contacts, semantic, category, address),
9
10
  style: PAGE_TOKEN, limit:, cursor:, api_key:)
10
11
  end
11
12
 
12
13
  def list_all(folder: nil, query: nil, label_ids: nil, sort: nil, date_from: nil, date_to: nil,
13
- from_contacts: nil, limit: nil, cursor: nil, api_key: nil)
14
- collect_all(ApiPaths::THREADS, list_query(folder, query, label_ids, sort, date_from, date_to, from_contacts),
14
+ from_contacts: nil, semantic: nil, category: nil, address: nil, limit: nil, cursor: nil, api_key: nil)
15
+ collect_all(ApiPaths::THREADS,
16
+ list_query(folder, query, label_ids, sort, date_from, date_to, from_contacts, semantic, category, address),
15
17
  style: PAGE_TOKEN, limit:, cursor:, api_key:)
16
18
  end
17
19
 
18
20
  def iterate(folder: nil, query: nil, label_ids: nil, sort: nil, date_from: nil, date_to: nil, from_contacts: nil,
19
- limit: nil, cursor: nil, api_key: nil, &)
20
- iterate_pages(ApiPaths::THREADS, list_query(folder, query, label_ids, sort, date_from, date_to, from_contacts),
21
+ semantic: nil, category: nil, address: nil, limit: nil, cursor: nil, api_key: nil, &)
22
+ iterate_pages(ApiPaths::THREADS,
23
+ list_query(folder, query, label_ids, sort, date_from, date_to, from_contacts, semantic, category, address),
21
24
  style: PAGE_TOKEN, limit:, cursor:, api_key:, &)
22
25
  end
23
26
 
@@ -42,6 +45,14 @@ module OpenEmail
42
45
  request(fill(ApiPaths::THREAD_UNSNOOZE, id:), method: :post, repeatable: true, api_key:)
43
46
  end
44
47
 
48
+ def mute(id, api_key: nil)
49
+ request(fill(ApiPaths::THREAD_MUTE, id:), method: :post, repeatable: true, api_key:)
50
+ end
51
+
52
+ def unmute(id, api_key: nil)
53
+ request(fill(ApiPaths::THREAD_UNMUTE, id:), method: :post, repeatable: true, api_key:)
54
+ end
55
+
45
56
  def list_attachments(id, message_id, api_key: nil)
46
57
  fetch_list(fill(ApiPaths::THREAD_MESSAGE_ATTACHMENTS, id:, messageId: message_id), api_key:)
47
58
  end
@@ -81,6 +92,10 @@ module OpenEmail
81
92
  request(fill(ApiPaths::THREAD_SUMMARY, id:), api_key:)
82
93
  end
83
94
 
95
+ def reply_suggestions(id, api_key: nil)
96
+ request(fill(ApiPaths::THREAD_REPLY_SUGGESTIONS, id:), api_key:)
97
+ end
98
+
84
99
  def restore(id, api_key: nil)
85
100
  request(fill(ApiPaths::THREAD_RESTORE, id:), method: :post, repeatable: true, api_key:)
86
101
  end
@@ -93,11 +108,25 @@ module OpenEmail
93
108
  request(fill(ApiPaths::THREAD_UNSUBSCRIBE, id:), method: :post, api_key:)
94
109
  end
95
110
 
111
+ def list_sender_categories(api_key: nil)
112
+ fetch_list(ApiPaths::SENDER_CATEGORIES, api_key:)
113
+ end
114
+
115
+ def set_sender_category(email, category, api_key: nil)
116
+ request(fill(ApiPaths::SENDER_CATEGORY, email:), method: :put, body: {"category" => category},
117
+ repeatable: true, api_key:)
118
+ end
119
+
120
+ def clear_sender_category(email, api_key: nil)
121
+ request(fill(ApiPaths::SENDER_CATEGORY, email:), method: :delete, api_key:)
122
+ end
123
+
96
124
  private
97
125
 
98
- def list_query(folder, query, label_ids, sort, date_from, date_to, from_contacts)
126
+ def list_query(folder, query, label_ids, sort, date_from, date_to, from_contacts, semantic, category, address)
99
127
  query_params(folder:, query:, label_ids: joined(label_ids), sort:, date_from: instant(date_from),
100
- date_to: instant(date_to), from_contacts: flag(from_contacts))
128
+ date_to: instant(date_to), from_contacts: flag(from_contacts), semantic: flag(semantic), category:,
129
+ address:)
101
130
  end
102
131
  end
103
132
  end
@@ -14,6 +14,22 @@ module OpenEmail
14
14
  def check_deliverability(domain, api_key: nil)
15
15
  request(ApiPaths::TOOLS_DELIVERABILITY, query: query_params(domain:), api_key:)
16
16
  end
17
+
18
+ def read_verification_code(body = nil, api_key: nil, **fields)
19
+ request(ApiPaths::TOOLS_VERIFICATION_CODE, method: :post, body: payload(body, fields), api_key:)
20
+ end
21
+
22
+ def check_address(email, deep: nil, api_key: nil)
23
+ request(ApiPaths::TOOLS_ADDRESS, query: query_params(email:, deep: flag(deep)), api_key:)
24
+ end
25
+
26
+ def check_addresses(body = nil, api_key: nil, **fields)
27
+ request(ApiPaths::TOOLS_ADDRESSES, method: :post, body: payload(body, fields), api_key:)
28
+ end
29
+
30
+ def estimate_cost(sends: nil, domains: nil, people: nil, ai_actions: nil, interval: nil, api_key: nil)
31
+ request(ApiPaths::TOOLS_COST, query: query_params(sends:, domains:, people:, ai_actions:, interval:), api_key:)
32
+ end
17
33
  end
18
34
  end
19
35
  end
@@ -3,22 +3,27 @@
3
3
  module OpenEmail
4
4
  module Resources
5
5
  class Tracking < Resource
6
- def list(opened: nil, clicked: nil, days: nil, minutes: nil, grain: nil, limit: nil, cursor: nil, api_key: nil)
7
- fetch_page(ApiPaths::TRACKING, list_query(opened, clicked, days, minutes, grain), limit:, cursor:, api_key:)
6
+ def list(opened: nil, clicked: nil, days: nil, minutes: nil, grain: nil, address: nil, limit: nil, cursor: nil,
7
+ api_key: nil)
8
+ fetch_page(ApiPaths::TRACKING, list_query(opened, clicked, days, minutes, grain, address), limit:, cursor:,
9
+ api_key:)
8
10
  end
9
11
 
10
- def list_all(opened: nil, clicked: nil, days: nil, minutes: nil, grain: nil, limit: nil, cursor: nil,
11
- api_key: nil)
12
- collect_all(ApiPaths::TRACKING, list_query(opened, clicked, days, minutes, grain), limit:, cursor:, api_key:)
12
+ def list_all(opened: nil, clicked: nil, days: nil, minutes: nil, grain: nil, address: nil, limit: nil,
13
+ cursor: nil, api_key: nil)
14
+ collect_all(ApiPaths::TRACKING, list_query(opened, clicked, days, minutes, grain, address), limit:, cursor:,
15
+ api_key:)
13
16
  end
14
17
 
15
- def iterate(opened: nil, clicked: nil, days: nil, minutes: nil, grain: nil, limit: nil, cursor: nil,
16
- api_key: nil, &)
17
- iterate_pages(ApiPaths::TRACKING, list_query(opened, clicked, days, minutes, grain), limit:, cursor:, api_key:, &)
18
+ def iterate(opened: nil, clicked: nil, days: nil, minutes: nil, grain: nil, address: nil, limit: nil,
19
+ cursor: nil, api_key: nil, &)
20
+ iterate_pages(ApiPaths::TRACKING, list_query(opened, clicked, days, minutes, grain, address), limit:, cursor:,
21
+ api_key:, &)
18
22
  end
19
23
 
20
- def get_stats(days: nil, minutes: nil, grain: nil, offset_minutes: nil, api_key: nil)
21
- request(ApiPaths::TRACKING_STATS, query: query_params(days:, minutes:, grain:, offset_minutes:), api_key:)
24
+ def get_stats(days: nil, minutes: nil, grain: nil, offset_minutes: nil, address: nil, api_key: nil)
25
+ request(ApiPaths::TRACKING_STATS, query: query_params(days:, minutes:, grain:, offset_minutes:, address:),
26
+ api_key:)
22
27
  end
23
28
 
24
29
  def get(id, api_key: nil)
@@ -51,8 +56,8 @@ module OpenEmail
51
56
 
52
57
  private
53
58
 
54
- def list_query(opened, clicked, days, minutes, grain)
55
- query_params(opened: flag(opened), clicked: flag(clicked), days:, minutes:, grain:)
59
+ def list_query(opened, clicked, days, minutes, grain, address)
60
+ query_params(opened: flag(opened), clicked: flag(clicked), days:, minutes:, grain:, address:)
56
61
  end
57
62
 
58
63
  def hit_query(include_machine)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenEmail
4
- VERSION = "0.0.1"
4
+ VERSION = "0.0.3"
5
5
  end
@@ -23,6 +23,7 @@ module OpenEmail
23
23
 
24
24
  def email(body)
25
25
  recipients(body).tap do |wire|
26
+ wire["followUpAt"] = instant(wire["followUpAt"]) if wire.key?("followUpAt")
26
27
  next unless wire.key?("attachments")
27
28
 
28
29
  attachments = wire.delete("attachments")
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openemail
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenEmail
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2026-10-04 00:00:00.000000000 Z
10
+ date: 2026-10-12 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: Send email and broadcasts, work with threads, drafts, labels, templates,
13
13
  rules, webhooks, tracking, contacts, audiences, sign-up forms, domains, suppressions,
@@ -38,6 +38,7 @@ files:
38
38
  - lib/openemail/resources/analytics.rb
39
39
  - lib/openemail/resources/app_host.rb
40
40
  - lib/openemail/resources/audiences.rb
41
+ - lib/openemail/resources/automations.rb
41
42
  - lib/openemail/resources/billing.rb
42
43
  - lib/openemail/resources/branding.rb
43
44
  - lib/openemail/resources/broadcasts.rb
@@ -49,20 +50,25 @@ files:
49
50
  - lib/openemail/resources/drafts.rb
50
51
  - lib/openemail/resources/emails.rb
51
52
  - lib/openemail/resources/encryption.rb
53
+ - lib/openemail/resources/events.rb
52
54
  - lib/openemail/resources/exports.rb
53
55
  - lib/openemail/resources/files.rb
56
+ - lib/openemail/resources/follow_ups.rb
54
57
  - lib/openemail/resources/forms.rb
55
58
  - lib/openemail/resources/imports.rb
56
59
  - lib/openemail/resources/keys.rb
60
+ - lib/openemail/resources/knowledge.rb
57
61
  - lib/openemail/resources/labels.rb
58
62
  - lib/openemail/resources/languages.rb
59
63
  - lib/openemail/resources/me.rb
60
64
  - lib/openemail/resources/members.rb
65
+ - lib/openemail/resources/out_of_office.rb
61
66
  - lib/openemail/resources/provider_imports.rb
62
67
  - lib/openemail/resources/roles.rb
63
68
  - lib/openemail/resources/rules.rb
64
69
  - lib/openemail/resources/security.rb
65
70
  - lib/openemail/resources/senders.rb
71
+ - lib/openemail/resources/sending.rb
66
72
  - lib/openemail/resources/settings.rb
67
73
  - lib/openemail/resources/subscriptions.rb
68
74
  - lib/openemail/resources/support.rb