mailtrap 2.7.0 → 2.9.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/CHANGELOG.md +16 -1
- data/Gemfile.lock +1 -1
- data/README.md +5 -2
- data/lib/mailtrap/account_access.rb +20 -0
- data/lib/mailtrap/account_accesses_api.rb +43 -0
- data/lib/mailtrap/billing_api.rb +18 -0
- data/lib/mailtrap/billing_usage.rb +16 -0
- data/lib/mailtrap/mail.rb +3 -1
- data/lib/mailtrap/project.rb +1 -1
- data/lib/mailtrap/sending_stat_group.rb +15 -0
- data/lib/mailtrap/sending_stats.rb +30 -0
- data/lib/mailtrap/stats_api.rb +151 -0
- data/lib/mailtrap/version.rb +1 -1
- data/lib/mailtrap.rb +3 -0
- metadata +8 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c1d2ec6f013c1c734b375a56217c2ec6373904851fdc28f25147932bf7d44225
|
|
4
|
+
data.tar.gz: 3a7c2994b477de66e566ad9cc41c5ca39d70641fa096c92a47af4c0289de6808
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1c2176601df89656a773772072952169caf35c0cff0d193cdab25c07956d09d9ab828b9e2995581512312f8e33f35605623b89052950752d8fc6a6c13cb3f0fc
|
|
7
|
+
data.tar.gz: 7661abf25236f9bec0a26f5463d92074a2e76b18bb9f5fc1067c3b2f810a7eed518e1a0d211ac61c11cde4eaaeb4542376ddd5ebd9785678adb225be3838092b
|
data/CHANGELOG.md
CHANGED
|
@@ -1,21 +1,36 @@
|
|
|
1
|
-
## [2.
|
|
1
|
+
## [2.9.0] - 2026-03-13
|
|
2
|
+
|
|
3
|
+
- Add Sending Stats API
|
|
4
|
+
- Parse `reply_to` as a structured address field instead of passing it as a raw
|
|
5
|
+
header when sending with Action Mailer
|
|
6
|
+
|
|
7
|
+
## [2.8.0] - 2026-03-03
|
|
8
|
+
|
|
9
|
+
- Add Account Accesses API
|
|
10
|
+
- Add Billing API
|
|
11
|
+
|
|
12
|
+
## [2.7.0] - 2026-02-24
|
|
13
|
+
|
|
2
14
|
- Add Sandbox Messages API
|
|
3
15
|
- Add Sending Domains API
|
|
4
16
|
- Add Sandbox Attachments API
|
|
5
17
|
- Add Accounts API
|
|
6
18
|
|
|
7
19
|
## [2.6.0] - 2026-01-27
|
|
20
|
+
|
|
8
21
|
- Add Inboxes API
|
|
9
22
|
- Add Projects API
|
|
10
23
|
- Models' `to_h` now returns all fields without compacting
|
|
11
24
|
|
|
12
25
|
## [2.5.0] - 2025-11-10
|
|
26
|
+
|
|
13
27
|
- Add Contact Imports API
|
|
14
28
|
- Add Suppressions API
|
|
15
29
|
- Write the message IDs to the message when sending with Action Mailer
|
|
16
30
|
- Fix versioning :)
|
|
17
31
|
|
|
18
32
|
## [2.4.1] - 2025-08-21
|
|
33
|
+
|
|
19
34
|
- Set `template_uuid` and `template_variables` when building mail from `Mail::Message`
|
|
20
35
|
|
|
21
36
|
## [2.4.0] - 2025-08-04
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -177,6 +177,7 @@ Email API:
|
|
|
177
177
|
- Full Email Sending – [`full.rb`](examples/full.rb)
|
|
178
178
|
- Batch Sending – [`batch.rb`](examples/batch.rb)
|
|
179
179
|
- Sending Domains API – [`sending_domains_api.rb`](examples/sending_domains_api.rb)
|
|
180
|
+
- Sending Stats API – [`stats_api.rb`](examples/stats_api.rb)
|
|
180
181
|
|
|
181
182
|
Email Sandbox (Testing):
|
|
182
183
|
|
|
@@ -191,9 +192,11 @@ Contact management:
|
|
|
191
192
|
|
|
192
193
|
General:
|
|
193
194
|
|
|
194
|
-
- Templates CRUD – [`email_templates_api.rb`](examples/email_templates_api.rb)
|
|
195
|
-
- Action Mailer – [`action_mailer.rb`](examples/action_mailer.rb)
|
|
196
195
|
- Accounts API – [`accounts_api.rb`](examples/accounts_api.rb)
|
|
196
|
+
- Account Accesses API – [`account_accesses_api.rb`](examples/account_accesses_api.rb)
|
|
197
|
+
- Billing API – [`billing_api.rb`](examples/billing_api.rb)
|
|
198
|
+
- Templates API – [`email_templates_api.rb`](examples/email_templates_api.rb)
|
|
199
|
+
- Action Mailer – [`action_mailer.rb`](examples/action_mailer.rb)
|
|
197
200
|
|
|
198
201
|
## Migration guide v1 → v2
|
|
199
202
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Mailtrap
|
|
4
|
+
# Data Transfer Object for AccountAccess
|
|
5
|
+
# @see https://docs.mailtrap.io/developers/account-management/access-control
|
|
6
|
+
# @attr_reader id [Integer] The access ID
|
|
7
|
+
# @attr_reader specifier_type [String] The type of the specifier
|
|
8
|
+
# @attr_reader specifier [Hash] The specifier for the access
|
|
9
|
+
# @attr_reader resources [Array<Hash>] The resources this access applies to
|
|
10
|
+
# @attr_reader permissions [Hash] The permissions granted
|
|
11
|
+
#
|
|
12
|
+
AccountAccess = Struct.new(
|
|
13
|
+
:id,
|
|
14
|
+
:specifier_type,
|
|
15
|
+
:specifier,
|
|
16
|
+
:resources,
|
|
17
|
+
:permissions,
|
|
18
|
+
keyword_init: true
|
|
19
|
+
)
|
|
20
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'base_api'
|
|
4
|
+
require_relative 'account_access'
|
|
5
|
+
|
|
6
|
+
module Mailtrap
|
|
7
|
+
class AccountAccessesAPI
|
|
8
|
+
include BaseAPI
|
|
9
|
+
|
|
10
|
+
attr_reader :account_id
|
|
11
|
+
|
|
12
|
+
self.response_class = AccountAccess
|
|
13
|
+
|
|
14
|
+
# Retrieves a list of account accesses with optional filtering by domain, inbox, or project IDs
|
|
15
|
+
# @param domain_ids [Array<Integer>] Optional array of domain IDs to filter by
|
|
16
|
+
# @param inbox_ids [Array<Integer>] Optional array of inbox IDs to filter by
|
|
17
|
+
# @param project_ids [Array<Integer>] Optional array of project IDs to filter by
|
|
18
|
+
# @return [Array<AccountAccess>] List of account access objects
|
|
19
|
+
# @!macro api_errors
|
|
20
|
+
def list(domain_ids: [], inbox_ids: [], project_ids: [])
|
|
21
|
+
query_params = {}
|
|
22
|
+
query_params[:domain_ids] = domain_ids unless domain_ids.empty?
|
|
23
|
+
query_params[:inbox_ids] = inbox_ids unless inbox_ids.empty?
|
|
24
|
+
query_params[:project_ids] = project_ids unless project_ids.empty?
|
|
25
|
+
|
|
26
|
+
base_list(query_params)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Deletes an account access
|
|
30
|
+
# @param account_access_id [Integer] The account access ID
|
|
31
|
+
# @return [Hash]
|
|
32
|
+
# @!macro api_errors
|
|
33
|
+
def delete(account_access_id)
|
|
34
|
+
base_delete(account_access_id)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
private
|
|
38
|
+
|
|
39
|
+
def base_path
|
|
40
|
+
"/api/accounts/#{account_id}/account_accesses"
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'base_api'
|
|
4
|
+
require_relative 'billing_usage'
|
|
5
|
+
|
|
6
|
+
module Mailtrap
|
|
7
|
+
class BillingAPI
|
|
8
|
+
include BaseAPI
|
|
9
|
+
|
|
10
|
+
# Get current billing cycle usage
|
|
11
|
+
# @return [BillingUsage] Billing usage data for account
|
|
12
|
+
# @!macro api_errors
|
|
13
|
+
def usage
|
|
14
|
+
response = client.get("/api/accounts/#{account_id}/billing/usage")
|
|
15
|
+
build_entity(response, BillingUsage)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Mailtrap
|
|
4
|
+
# Data Transfer Object for Billing Usage data
|
|
5
|
+
# @see https://docs.mailtrap.io/developers/account-management/billing
|
|
6
|
+
# @attr_reader billing [Hash] The billing cycle details
|
|
7
|
+
# @attr_reader testing [Hash] Testing subscription usage
|
|
8
|
+
# @attr_reader sending [Hash] Sending subscription usage
|
|
9
|
+
#
|
|
10
|
+
BillingUsage = Struct.new(
|
|
11
|
+
:billing,
|
|
12
|
+
:testing,
|
|
13
|
+
:sending,
|
|
14
|
+
keyword_init: true
|
|
15
|
+
)
|
|
16
|
+
end
|
data/lib/mailtrap/mail.rb
CHANGED
|
@@ -17,6 +17,7 @@ module Mailtrap
|
|
|
17
17
|
category
|
|
18
18
|
customvariables
|
|
19
19
|
contenttype
|
|
20
|
+
replyto
|
|
20
21
|
].freeze
|
|
21
22
|
private_constant :SPECIAL_HEADERS
|
|
22
23
|
|
|
@@ -189,12 +190,13 @@ module Mailtrap
|
|
|
189
190
|
# Builds a mail object from Mail::Message
|
|
190
191
|
# @param message [Mail::Message]
|
|
191
192
|
# @return [Mailtrap::Mail::Base]
|
|
192
|
-
def from_message(message)
|
|
193
|
+
def from_message(message) # rubocop:disable Metrics/AbcSize
|
|
193
194
|
Mailtrap::Mail::Base.new(
|
|
194
195
|
from: prepare_addresses(message['from']).first,
|
|
195
196
|
to: prepare_addresses(message['to']),
|
|
196
197
|
cc: prepare_addresses(message['cc']),
|
|
197
198
|
bcc: prepare_addresses(message['bcc']),
|
|
199
|
+
reply_to: prepare_addresses(message['reply-to']).first,
|
|
198
200
|
subject: message.subject,
|
|
199
201
|
text: prepare_text_part(message),
|
|
200
202
|
html: prepare_html_part(message),
|
data/lib/mailtrap/project.rb
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
module Mailtrap
|
|
4
4
|
# Data Transfer Object for Project
|
|
5
|
-
# @see https://
|
|
5
|
+
# @see https://docs.mailtrap.io/developers/email-sandbox/projects
|
|
6
6
|
# @attr_reader id [Integer] The project ID
|
|
7
7
|
# @attr_reader name [String] The project name
|
|
8
8
|
# @attr_reader share_links [Hash] Admin and viewer share links
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Mailtrap
|
|
4
|
+
# Data Transfer Object for grouped Sending Stats data
|
|
5
|
+
# @attr_reader name [Symbol] Group type (:category, :date, :sending_domain_id, :email_service_provider)
|
|
6
|
+
# @attr_reader value [String, Integer] Group value (e.g., "Transactional", "2026-01-01", 1, "Gmail")
|
|
7
|
+
# @attr_reader stats [SendingStats] Sending stats for this group
|
|
8
|
+
#
|
|
9
|
+
SendingStatGroup = Struct.new(
|
|
10
|
+
:name,
|
|
11
|
+
:value,
|
|
12
|
+
:stats,
|
|
13
|
+
keyword_init: true
|
|
14
|
+
)
|
|
15
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Mailtrap
|
|
4
|
+
# Data Transfer Object for Sending Stats data
|
|
5
|
+
# @see https://docs.mailtrap.io/developers/email-sending-stats
|
|
6
|
+
# @attr_reader delivery_count [Integer] Number of delivered emails
|
|
7
|
+
# @attr_reader delivery_rate [Float] Delivery rate
|
|
8
|
+
# @attr_reader bounce_count [Integer] Number of bounced emails
|
|
9
|
+
# @attr_reader bounce_rate [Float] Bounce rate
|
|
10
|
+
# @attr_reader open_count [Integer] Number of opened emails
|
|
11
|
+
# @attr_reader open_rate [Float] Open rate
|
|
12
|
+
# @attr_reader click_count [Integer] Number of clicked emails
|
|
13
|
+
# @attr_reader click_rate [Float] Click rate
|
|
14
|
+
# @attr_reader spam_count [Integer] Number of spam reports
|
|
15
|
+
# @attr_reader spam_rate [Float] Spam rate
|
|
16
|
+
#
|
|
17
|
+
SendingStats = Struct.new(
|
|
18
|
+
:delivery_count,
|
|
19
|
+
:delivery_rate,
|
|
20
|
+
:bounce_count,
|
|
21
|
+
:bounce_rate,
|
|
22
|
+
:open_count,
|
|
23
|
+
:open_rate,
|
|
24
|
+
:click_count,
|
|
25
|
+
:click_rate,
|
|
26
|
+
:spam_count,
|
|
27
|
+
:spam_rate,
|
|
28
|
+
keyword_init: true
|
|
29
|
+
)
|
|
30
|
+
end
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'date'
|
|
4
|
+
require_relative 'base_api'
|
|
5
|
+
require_relative 'sending_stats'
|
|
6
|
+
require_relative 'sending_stat_group'
|
|
7
|
+
|
|
8
|
+
module Mailtrap
|
|
9
|
+
class StatsAPI
|
|
10
|
+
include BaseAPI
|
|
11
|
+
|
|
12
|
+
ARRAY_FILTERS = %i[sending_domain_ids sending_streams categories email_service_providers].freeze
|
|
13
|
+
GROUP_KEYS = {
|
|
14
|
+
'domains' => :sending_domain_id,
|
|
15
|
+
'categories' => :category,
|
|
16
|
+
'email_service_providers' => :email_service_provider,
|
|
17
|
+
'date' => :date
|
|
18
|
+
}.freeze
|
|
19
|
+
|
|
20
|
+
# Get aggregated sending stats
|
|
21
|
+
# @param start_date [String, Date, Time] Start date for the stats period (required)
|
|
22
|
+
# @param end_date [String, Date, Time] End date for the stats period (required)
|
|
23
|
+
# @param sending_domain_ids [Array<Integer>] Filter by sending domain IDs
|
|
24
|
+
# @param sending_streams [Array<String>] Filter by sending streams
|
|
25
|
+
# @param categories [Array<String>] Filter by categories
|
|
26
|
+
# @param email_service_providers [Array<String>] Filter by email service providers
|
|
27
|
+
# @return [SendingStats] Aggregated sending stats
|
|
28
|
+
# @!macro api_errors
|
|
29
|
+
def get(start_date:, end_date:, sending_domain_ids: nil, sending_streams: nil, categories: nil, # rubocop:disable Metrics/ParameterLists
|
|
30
|
+
email_service_providers: nil)
|
|
31
|
+
query_params = build_query_params(
|
|
32
|
+
start_date, end_date,
|
|
33
|
+
{ sending_domain_ids:, sending_streams:, categories:, email_service_providers: }
|
|
34
|
+
)
|
|
35
|
+
response = client.get(base_path, query_params)
|
|
36
|
+
build_entity(response, SendingStats)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Get sending stats grouped by domain
|
|
40
|
+
# @param start_date [String, Date, Time] Start date for the stats period (required)
|
|
41
|
+
# @param end_date [String, Date, Time] End date for the stats period (required)
|
|
42
|
+
# @param sending_domain_ids [Array<Integer>] Filter by sending domain IDs
|
|
43
|
+
# @param sending_streams [Array<String>] Filter by sending streams
|
|
44
|
+
# @param categories [Array<String>] Filter by categories
|
|
45
|
+
# @param email_service_providers [Array<String>] Filter by email service providers
|
|
46
|
+
# @return [Array<SendingStatGroup>] Array of SendingStatGroup structs with sending_domain_id and stats
|
|
47
|
+
# @!macro api_errors
|
|
48
|
+
def by_domain(start_date:, end_date:, sending_domain_ids: nil, sending_streams: nil, categories: nil, # rubocop:disable Metrics/ParameterLists
|
|
49
|
+
email_service_providers: nil)
|
|
50
|
+
grouped_stats('domains', start_date, end_date,
|
|
51
|
+
{ sending_domain_ids:, sending_streams:, categories:, email_service_providers: })
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Get sending stats grouped by category
|
|
55
|
+
# @param start_date [String, Date, Time] Start date for the stats period (required)
|
|
56
|
+
# @param end_date [String, Date, Time] End date for the stats period (required)
|
|
57
|
+
# @param sending_domain_ids [Array<Integer>] Filter by sending domain IDs
|
|
58
|
+
# @param sending_streams [Array<String>] Filter by sending streams
|
|
59
|
+
# @param categories [Array<String>] Filter by categories
|
|
60
|
+
# @param email_service_providers [Array<String>] Filter by email service providers
|
|
61
|
+
# @return [Array<SendingStatGroup>] Array of SendingStatGroup structs with category and stats
|
|
62
|
+
# @!macro api_errors
|
|
63
|
+
def by_category(start_date:, end_date:, sending_domain_ids: nil, sending_streams: nil, categories: nil, # rubocop:disable Metrics/ParameterLists
|
|
64
|
+
email_service_providers: nil)
|
|
65
|
+
grouped_stats('categories', start_date, end_date,
|
|
66
|
+
{ sending_domain_ids:, sending_streams:, categories:, email_service_providers: })
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Get sending stats grouped by email service provider
|
|
70
|
+
# @param start_date [String, Date, Time] Start date for the stats period (required)
|
|
71
|
+
# @param end_date [String, Date, Time] End date for the stats period (required)
|
|
72
|
+
# @param sending_domain_ids [Array<Integer>] Filter by sending domain IDs
|
|
73
|
+
# @param sending_streams [Array<String>] Filter by sending streams
|
|
74
|
+
# @param categories [Array<String>] Filter by categories
|
|
75
|
+
# @param email_service_providers [Array<String>] Filter by email service providers
|
|
76
|
+
# @return [Array<SendingStatGroup>] Array of SendingStatGroup structs with email_service_provider and stats
|
|
77
|
+
# @!macro api_errors
|
|
78
|
+
def by_email_service_provider(start_date:, end_date:, sending_domain_ids: nil, sending_streams: nil, # rubocop:disable Metrics/ParameterLists
|
|
79
|
+
categories: nil, email_service_providers: nil)
|
|
80
|
+
grouped_stats('email_service_providers', start_date, end_date,
|
|
81
|
+
{ sending_domain_ids:, sending_streams:, categories:, email_service_providers: })
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Get sending stats grouped by date
|
|
85
|
+
# @param start_date [String, Date, Time] Start date for the stats period (required)
|
|
86
|
+
# @param end_date [String, Date, Time] End date for the stats period (required)
|
|
87
|
+
# @param sending_domain_ids [Array<Integer>] Filter by sending domain IDs
|
|
88
|
+
# @param sending_streams [Array<String>] Filter by sending streams
|
|
89
|
+
# @param categories [Array<String>] Filter by categories
|
|
90
|
+
# @param email_service_providers [Array<String>] Filter by email service providers
|
|
91
|
+
# @return [Array<SendingStatGroup>] Array of SendingStatGroup structs with date and stats
|
|
92
|
+
# @!macro api_errors
|
|
93
|
+
def by_date(start_date:, end_date:, sending_domain_ids: nil, sending_streams: nil, categories: nil, # rubocop:disable Metrics/ParameterLists
|
|
94
|
+
email_service_providers: nil)
|
|
95
|
+
grouped_stats('date', start_date, end_date,
|
|
96
|
+
{ sending_domain_ids:, sending_streams:, categories:, email_service_providers: })
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
private
|
|
100
|
+
|
|
101
|
+
def grouped_stats(group, start_date, end_date, filters)
|
|
102
|
+
query_params = build_query_params(start_date, end_date, filters)
|
|
103
|
+
response = client.get("#{base_path}/#{group}", query_params)
|
|
104
|
+
group_key = GROUP_KEYS.fetch(group)
|
|
105
|
+
|
|
106
|
+
response.map do |item|
|
|
107
|
+
SendingStatGroup.new(
|
|
108
|
+
name: group_key,
|
|
109
|
+
value: item[group_key],
|
|
110
|
+
stats: build_entity(item[:stats], SendingStats)
|
|
111
|
+
)
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
def build_query_params(start_date, end_date, filters)
|
|
116
|
+
params = { start_date: normalize_date(start_date), end_date: normalize_date(end_date) }
|
|
117
|
+
|
|
118
|
+
ARRAY_FILTERS.each do |filter_key|
|
|
119
|
+
values = filters[filter_key]
|
|
120
|
+
params["#{filter_key}[]"] = values if values
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
params
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
def normalize_date(value)
|
|
127
|
+
case value
|
|
128
|
+
when Date
|
|
129
|
+
value.iso8601
|
|
130
|
+
when Time
|
|
131
|
+
value.strftime('%F')
|
|
132
|
+
when String
|
|
133
|
+
unless /\A\d{4}-\d{2}-\d{2}\z/.match?(value)
|
|
134
|
+
raise ArgumentError,
|
|
135
|
+
"Invalid date: #{value.inspect}. Expected a Date, Time, or String in YYYY-MM-DD format."
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
Date.iso8601(value).iso8601
|
|
139
|
+
else
|
|
140
|
+
raise ArgumentError,
|
|
141
|
+
"Invalid date: #{value.inspect}. Expected a Date, Time, or String in YYYY-MM-DD format."
|
|
142
|
+
end
|
|
143
|
+
rescue Date::Error
|
|
144
|
+
raise ArgumentError, "Invalid date: #{value.inspect}. Expected a Date, Time, or String in YYYY-MM-DD format."
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
def base_path
|
|
148
|
+
"/api/accounts/#{account_id}/stats"
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
end
|
data/lib/mailtrap/version.rb
CHANGED
data/lib/mailtrap.rb
CHANGED
|
@@ -5,6 +5,8 @@ require_relative 'mailtrap/mail'
|
|
|
5
5
|
require_relative 'mailtrap/errors'
|
|
6
6
|
require_relative 'mailtrap/version'
|
|
7
7
|
require_relative 'mailtrap/accounts_api'
|
|
8
|
+
require_relative 'mailtrap/account_accesses_api'
|
|
9
|
+
require_relative 'mailtrap/billing_api'
|
|
8
10
|
require_relative 'mailtrap/email_templates_api'
|
|
9
11
|
require_relative 'mailtrap/contacts_api'
|
|
10
12
|
require_relative 'mailtrap/contact_lists_api'
|
|
@@ -16,6 +18,7 @@ require_relative 'mailtrap/projects_api'
|
|
|
16
18
|
require_relative 'mailtrap/inboxes_api'
|
|
17
19
|
require_relative 'mailtrap/sandbox_messages_api'
|
|
18
20
|
require_relative 'mailtrap/sandbox_attachments_api'
|
|
21
|
+
require_relative 'mailtrap/stats_api'
|
|
19
22
|
|
|
20
23
|
module Mailtrap
|
|
21
24
|
# @!macro api_errors
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mailtrap
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.9.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Railsware Products Studio LLC
|
|
@@ -43,12 +43,16 @@ files:
|
|
|
43
43
|
- Rakefile
|
|
44
44
|
- lib/mailtrap.rb
|
|
45
45
|
- lib/mailtrap/account.rb
|
|
46
|
+
- lib/mailtrap/account_access.rb
|
|
47
|
+
- lib/mailtrap/account_accesses_api.rb
|
|
46
48
|
- lib/mailtrap/accounts_api.rb
|
|
47
49
|
- lib/mailtrap/action_mailer.rb
|
|
48
50
|
- lib/mailtrap/action_mailer/delivery_method.rb
|
|
49
51
|
- lib/mailtrap/action_mailer/railtie.rb
|
|
50
52
|
- lib/mailtrap/attachment.rb
|
|
51
53
|
- lib/mailtrap/base_api.rb
|
|
54
|
+
- lib/mailtrap/billing_api.rb
|
|
55
|
+
- lib/mailtrap/billing_usage.rb
|
|
52
56
|
- lib/mailtrap/client.rb
|
|
53
57
|
- lib/mailtrap/contact.rb
|
|
54
58
|
- lib/mailtrap/contact_field.rb
|
|
@@ -75,6 +79,9 @@ files:
|
|
|
75
79
|
- lib/mailtrap/sandbox_messages_api.rb
|
|
76
80
|
- lib/mailtrap/sending_domain.rb
|
|
77
81
|
- lib/mailtrap/sending_domains_api.rb
|
|
82
|
+
- lib/mailtrap/sending_stat_group.rb
|
|
83
|
+
- lib/mailtrap/sending_stats.rb
|
|
84
|
+
- lib/mailtrap/stats_api.rb
|
|
78
85
|
- lib/mailtrap/suppression.rb
|
|
79
86
|
- lib/mailtrap/suppressions_api.rb
|
|
80
87
|
- lib/mailtrap/version.rb
|