mailersend-ruby 3.4.1 → 3.6.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/README.md +27 -0
- data/fixtures/account/account_get.yml +43 -0
- data/fixtures/account/account_get_without_whatsapp.yml +43 -0
- data/fixtures/activity/activity_get_activity.yml +1 -1
- data/fixtures/api_quota/api_quota_get.yml +1 -1
- data/fixtures/bulk_email/bulk_email_send.yml +1 -1
- data/fixtures/bulk_email/bulk_email_status.yml +1 -1
- data/fixtures/dmarc_monitoring/add_favorite.yml +1 -1
- data/fixtures/dmarc_monitoring/create.yml +1 -1
- data/fixtures/dmarc_monitoring/delete.yml +1 -1
- data/fixtures/dmarc_monitoring/list.yml +1 -1
- data/fixtures/dmarc_monitoring/remove_favorite.yml +1 -1
- data/fixtures/dmarc_monitoring/report.yml +1 -1
- data/fixtures/dmarc_monitoring/report_by_ip.yml +1 -1
- data/fixtures/dmarc_monitoring/report_sources.yml +1 -1
- data/fixtures/dmarc_monitoring/update.yml +1 -1
- data/fixtures/domains/domains_add.yml +1 -1
- data/fixtures/domains/domains_delete.yml +1 -1
- data/fixtures/domains/domains_dns.yml +1 -1
- data/fixtures/domains/domains_list.yml +1 -1
- data/fixtures/domains/domains_recipients.yml +1 -1
- data/fixtures/domains/domains_settings.yml +1 -1
- data/fixtures/domains/domains_single.yml +1 -1
- data/fixtures/domains/domains_verify.yml +1 -1
- data/fixtures/email/email_send.yml +1 -1
- data/fixtures/email/email_send_template_language.yml +1 -1
- data/fixtures/emails/emails_list_emails.yml +1 -1
- data/fixtures/emails/emails_list_emails_empty_page.yml +1 -1
- data/fixtures/emails/emails_single_email.yml +1 -1
- data/fixtures/inbound_routing/inbound_routing_delete.yml +1 -1
- data/fixtures/inbound_routing/inbound_routing_list.yml +1 -1
- data/fixtures/inbound_routing/inbound_routing_single.yml +1 -1
- data/fixtures/messages/messages_list_messages.yml +1 -1
- data/fixtures/messages/messages_single_message.yml +1 -1
- data/fixtures/recipients/recipients_delete.yml +1 -1
- data/fixtures/recipients/recipients_list.yml +1 -1
- data/fixtures/recipients/recipients_single.yml +1 -1
- data/fixtures/scheduled_messages/scheduled_messages_delete.yml +1 -1
- data/fixtures/scheduled_messages/scheduled_messages_get_list.yml +1 -1
- data/fixtures/scheduled_messages/scheduled_messages_get_single.yml +1 -1
- data/fixtures/sms_activity/sms_activity_list.yml +1 -1
- data/fixtures/sms_inbounds/sms_inbounds_add_sms_inbound_route.yml +1 -1
- data/fixtures/sms_inbounds/sms_inbounds_delete_sms_inbound_route.yml +1 -1
- data/fixtures/sms_inbounds/sms_inbounds_get_sms_inbound_route.yml +1 -1
- data/fixtures/sms_inbounds/sms_inbounds_list_sms_inbounds.yml +1 -1
- data/fixtures/sms_inbounds/sms_inbounds_update_sms_inbound_route.yml +1 -1
- data/fixtures/sms_messages/sms_messages_list_sms_messages.yml +1 -1
- data/fixtures/sms_number/sms_number_delete.yml +2 -2
- data/fixtures/sms_number/sms_number_get.yml +1 -1
- data/fixtures/sms_number/sms_number_list.yml +1 -1
- data/fixtures/sms_number/sms_number_update.yml +1 -1
- data/fixtures/sms_recipient/sms_recipient_get.yml +1 -1
- data/fixtures/sms_recipient/sms_recipient_list.yml +1 -1
- data/fixtures/sms_recipient/sms_recipient_update.yml +1 -1
- data/fixtures/sms_webhooks/sms_webhooks_add_sms_webhook_route.yml +1 -1
- data/fixtures/sms_webhooks/sms_webhooks_delete_sms_webhook_route.yml +1 -1
- data/fixtures/sms_webhooks/sms_webhooks_get_sms_webhook_route.yml +1 -1
- data/fixtures/sms_webhooks/sms_webhooks_list_sms_webhooks.yml +1 -1
- data/fixtures/sms_webhooks/sms_webhooks_update_sms_webhook_route.yml +1 -1
- data/fixtures/suppressions/suppressions_add_to_blocklist.yml +1 -1
- data/fixtures/suppressions/suppressions_add_to_hard_bounces.yml +1 -1
- data/fixtures/suppressions/suppressions_add_to_spam_complaints.yml +1 -1
- data/fixtures/suppressions/suppressions_add_to_unsubscribers.yml +1 -1
- data/fixtures/suppressions/suppressions_delete_from_blocklist.yml +1 -1
- data/fixtures/suppressions/suppressions_delete_from_hard_bounces.yml +1 -1
- data/fixtures/suppressions/suppressions_delete_from_spam_complaints.yml +1 -1
- data/fixtures/suppressions/suppressions_delete_from_unsubscribers.yml +1 -1
- data/fixtures/suppressions/suppressions_get_from_blocklist.yml +1 -1
- data/fixtures/suppressions/suppressions_get_hard_bounces.yml +1 -1
- data/fixtures/suppressions/suppressions_get_spam_complaints.yml +1 -1
- data/fixtures/suppressions/suppressions_get_unsubscribes.yml +1 -1
- data/fixtures/templates/templates_delete.yml +1 -1
- data/fixtures/templates/templates_list.yml +1 -1
- data/fixtures/templates/templates_single.yml +1 -1
- data/fixtures/tokens/tokens_create.yml +1 -1
- data/fixtures/tokens/tokens_delete.yml +1 -1
- data/fixtures/tokens/tokens_update.yml +1 -1
- data/fixtures/webhooks/webhooks_create.yml +1 -1
- data/fixtures/webhooks/webhooks_delete.yml +1 -1
- data/fixtures/webhooks/webhooks_list.yml +1 -1
- data/fixtures/webhooks/webhooks_single.yml +1 -1
- data/fixtures/whatsapp/whatsapp_send.yml +1 -1
- data/fixtures/whatsapp/whatsapp_send_multiple_recipients.yml +1 -1
- data/fixtures/whatsapp/whatsapp_send_personalization.yml +1 -1
- data/fixtures/whatsapp_activities/whatsapp_activities_list.yml +1 -1
- data/fixtures/whatsapp_inbound_messages/whatsapp_inbound_messages_get.yml +1 -1
- data/fixtures/whatsapp_inbound_messages/whatsapp_inbound_messages_list.yml +1 -1
- data/fixtures/whatsapp_items/whatsapp_items_get.yml +1 -1
- data/fixtures/whatsapp_items/whatsapp_items_list.yml +1 -1
- data/fixtures/whatsapp_messages/whatsapp_messages_get.yml +1 -1
- data/fixtures/whatsapp_messages/whatsapp_messages_list.yml +1 -1
- data/fixtures/whatsapp_recipient/whatsapp_recipient_get.yml +1 -1
- data/fixtures/whatsapp_recipient/whatsapp_recipient_list.yml +1 -1
- data/fixtures/whatsapp_templates/whatsapp_templates_get.yml +1 -1
- data/fixtures/whatsapp_templates/whatsapp_templates_list.yml +1 -1
- data/lib/mailersend/account/account.rb +16 -0
- data/lib/mailersend/activity/activity.rb +1 -1
- data/lib/mailersend/analytics/analytics.rb +4 -4
- data/lib/mailersend/api_quota/api_quota.rb +1 -1
- data/lib/mailersend/bulk_email/bulk_email.rb +2 -2
- data/lib/mailersend/client.rb +16 -1
- data/lib/mailersend/dmarc_monitoring/dmarc_monitoring.rb +9 -9
- data/lib/mailersend/domains/domains.rb +8 -8
- data/lib/mailersend/email/email.rb +1 -1
- data/lib/mailersend/email_verification/email_verification.rb +6 -6
- data/lib/mailersend/emails/emails.rb +2 -2
- data/lib/mailersend/inbound_routing/inbound_routing.rb +5 -5
- data/lib/mailersend/messages/messages.rb +2 -2
- data/lib/mailersend/recipients/recipients.rb +3 -3
- data/lib/mailersend/scheduled_messages/scheduled_messages.rb +3 -3
- data/lib/mailersend/sender_identity/sender_identity.rb +8 -8
- data/lib/mailersend/sms/sms.rb +1 -1
- data/lib/mailersend/sms_activity/sms_activity.rb +1 -1
- data/lib/mailersend/sms_inbounds/sms_inbounds.rb +5 -5
- data/lib/mailersend/sms_messages/sms_messages.rb +2 -2
- data/lib/mailersend/sms_number/sms_number.rb +4 -4
- data/lib/mailersend/sms_recipient/sms_recipient.rb +3 -3
- data/lib/mailersend/sms_webhooks/sms_webhooks.rb +5 -5
- data/lib/mailersend/suppressions/suppressions.rb +12 -12
- data/lib/mailersend/templates/templates.rb +3 -3
- data/lib/mailersend/tokens/tokens.rb +3 -3
- data/lib/mailersend/version.rb +1 -1
- data/lib/mailersend/webhooks/webhooks.rb +5 -5
- data/lib/mailersend/whatsapp/whatsapp.rb +1 -1
- data/lib/mailersend/whatsapp_activities/whatsapp_activities.rb +1 -1
- data/lib/mailersend/whatsapp_inbound_messages/whatsapp_inbound_messages.rb +2 -2
- data/lib/mailersend/whatsapp_items/whatsapp_items.rb +2 -2
- data/lib/mailersend/whatsapp_messages/whatsapp_messages.rb +2 -2
- data/lib/mailersend/whatsapp_recipient/whatsapp_recipient.rb +2 -2
- data/lib/mailersend/whatsapp_templates/whatsapp_templates.rb +2 -2
- data/lib/mailersend.rb +1 -0
- data/spec/account_rspec.rb +43 -0
- data/spec/client_rspec.rb +33 -0
- data/spec/emails_rspec.rb +7 -7
- metadata +6 -1
|
@@ -24,12 +24,12 @@ module Mailersend
|
|
|
24
24
|
hash = {
|
|
25
25
|
'domain_id' => domain_id
|
|
26
26
|
}
|
|
27
|
-
client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path:
|
|
27
|
+
client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "#{client.api_path}/webhooks",
|
|
28
28
|
query: URI.encode_www_form(hash)))
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
def single(webhook_id:)
|
|
32
|
-
client.http.get("#{
|
|
32
|
+
client.http.get("#{client.api_base_url}/webhooks/#{webhook_id}")
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
def create(url:, name:, events:, domain_id:, enabled: nil)
|
|
@@ -41,7 +41,7 @@ module Mailersend
|
|
|
41
41
|
'enabled' => enabled.to_s == 'true'
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
client.http.post("#{
|
|
44
|
+
client.http.post("#{client.api_base_url}/webhooks", json: hash.compact)
|
|
45
45
|
end
|
|
46
46
|
|
|
47
47
|
def update(webhook_id:, url: nil, name: nil, events: nil, enabled: nil)
|
|
@@ -51,11 +51,11 @@ module Mailersend
|
|
|
51
51
|
'events' => events,
|
|
52
52
|
'enabled' => enabled.to_s == 'true'
|
|
53
53
|
}
|
|
54
|
-
client.http.put("#{
|
|
54
|
+
client.http.put("#{client.api_base_url}/webhooks/#{webhook_id}", json: hash.compact)
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
def delete(webhook_id:)
|
|
58
|
-
client.http.delete("#{
|
|
58
|
+
client.http.delete("#{client.api_base_url}/webhooks/#{webhook_id}")
|
|
59
59
|
end
|
|
60
60
|
end
|
|
61
61
|
end
|
|
@@ -41,7 +41,7 @@ module Mailersend
|
|
|
41
41
|
'personalization' => @personalization
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
client.http.post("#{
|
|
44
|
+
client.http.post("#{client.api_base_url}/whatsapp/send", json: message.delete_if { |_, value| value.to_s.strip == '' || value == [] || value == {} })
|
|
45
45
|
end
|
|
46
46
|
end
|
|
47
47
|
end
|
|
@@ -38,7 +38,7 @@ module Mailersend
|
|
|
38
38
|
'limit' => limit
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path:
|
|
41
|
+
client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "#{client.api_path}/whatsapp/activities",
|
|
42
42
|
query: URI.encode_www_form(hash.compact)))
|
|
43
43
|
end
|
|
44
44
|
end
|
|
@@ -36,12 +36,12 @@ module Mailersend
|
|
|
36
36
|
'limit' => limit
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path:
|
|
39
|
+
client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "#{client.api_path}/whatsapp/inbound-messages",
|
|
40
40
|
query: URI.encode_www_form(hash.compact)))
|
|
41
41
|
end
|
|
42
42
|
|
|
43
43
|
def get(whatsapp_inbound_message_id:)
|
|
44
|
-
client.http.get("#{
|
|
44
|
+
client.http.get("#{client.api_base_url}/whatsapp/inbound-messages/#{whatsapp_inbound_message_id}")
|
|
45
45
|
end
|
|
46
46
|
end
|
|
47
47
|
end
|
|
@@ -46,12 +46,12 @@ module Mailersend
|
|
|
46
46
|
'limit' => limit
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path:
|
|
49
|
+
client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "#{client.api_path}/whatsapp/items",
|
|
50
50
|
query: URI.encode_www_form(hash.compact)))
|
|
51
51
|
end
|
|
52
52
|
|
|
53
53
|
def get(whatsapp_item_id:)
|
|
54
|
-
client.http.get("#{
|
|
54
|
+
client.http.get("#{client.api_base_url}/whatsapp/items/#{whatsapp_item_id}")
|
|
55
55
|
end
|
|
56
56
|
end
|
|
57
57
|
end
|
|
@@ -36,12 +36,12 @@ module Mailersend
|
|
|
36
36
|
'limit' => limit
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path:
|
|
39
|
+
client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "#{client.api_path}/whatsapp/messages",
|
|
40
40
|
query: URI.encode_www_form(hash.compact)))
|
|
41
41
|
end
|
|
42
42
|
|
|
43
43
|
def get(whatsapp_message_id:)
|
|
44
|
-
client.http.get("#{
|
|
44
|
+
client.http.get("#{client.api_base_url}/whatsapp/messages/#{whatsapp_message_id}")
|
|
45
45
|
end
|
|
46
46
|
end
|
|
47
47
|
end
|
|
@@ -27,12 +27,12 @@ module Mailersend
|
|
|
27
27
|
'limit' => limit
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path:
|
|
30
|
+
client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "#{client.api_path}/whatsapp/recipients",
|
|
31
31
|
query: URI.encode_www_form(hash.compact)))
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
def get(whatsapp_recipient_id:)
|
|
35
|
-
client.http.get("#{
|
|
35
|
+
client.http.get("#{client.api_base_url}/whatsapp/recipients/#{whatsapp_recipient_id}")
|
|
36
36
|
end
|
|
37
37
|
end
|
|
38
38
|
end
|
|
@@ -33,12 +33,12 @@ module Mailersend
|
|
|
33
33
|
'limit' => limit
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path:
|
|
36
|
+
client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "#{client.api_path}/whatsapp/templates",
|
|
37
37
|
query: URI.encode_www_form(hash.compact)))
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
def get(whatsapp_template_id:)
|
|
41
|
-
client.http.get("#{
|
|
41
|
+
client.http.get("#{client.api_base_url}/whatsapp/templates/#{whatsapp_template_id}")
|
|
42
42
|
end
|
|
43
43
|
end
|
|
44
44
|
end
|
data/lib/mailersend.rb
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require_relative 'mailersend/client'
|
|
4
4
|
require_relative 'mailersend/version'
|
|
5
|
+
require_relative 'mailersend/account/account'
|
|
5
6
|
require_relative 'mailersend/activity/activity'
|
|
6
7
|
require_relative 'mailersend/api_quota/api_quota'
|
|
7
8
|
require_relative 'mailersend/analytics/analytics'
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'rspec'
|
|
4
|
+
require 'vcr'
|
|
5
|
+
require 'json'
|
|
6
|
+
|
|
7
|
+
VCR.configure do |config|
|
|
8
|
+
config.cassette_library_dir = './fixtures'
|
|
9
|
+
config.hook_into :webmock
|
|
10
|
+
config.filter_sensitive_data('<AUTH>') do |interaction|
|
|
11
|
+
interaction.request.headers['Authorization'][0]
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
RSpec.describe Mailersend::Account do
|
|
16
|
+
let(:client) { Mailersend::Client.new(API_TOKEN) }
|
|
17
|
+
let(:account) { Mailersend::Account.new(client) }
|
|
18
|
+
|
|
19
|
+
it 'returns the account' do
|
|
20
|
+
VCR.use_cassette('account/account_get') do
|
|
21
|
+
response = account.get_account
|
|
22
|
+
data = JSON.parse(response.body)['data']
|
|
23
|
+
|
|
24
|
+
expect(response.status).to eq(200)
|
|
25
|
+
expect(response.uri.to_s).to eq('https://api.mailersend.com/2026-10/account')
|
|
26
|
+
expect(data).to include('name' => 'Acme Inc', 'status' => 'approved', 'plan_type' => 'starter', 'data_retention_days' => 7)
|
|
27
|
+
expect(data['emails']).to eq('sent' => 12_000, 'received' => 430, 'limit' => -1)
|
|
28
|
+
expect(data['rate_limits']).to eq('general' => 60, 'email' => 120, 'bulk_email' => 10, 'activity' => 10)
|
|
29
|
+
expect(data['resources']).to include('domains' => { 'used' => 3, 'limit' => 10 }, 'free_accountant_seat' => { 'used' => 0, 'limit' => 0 })
|
|
30
|
+
expect(data['addons']).to include('whatsapp' => { 'sent' => 800, 'limit' => 1000 }, 'sms' => { 'sent' => 120, 'received' => 30, 'limit' => -1 })
|
|
31
|
+
expect(data['addons']).to include('phone_numbers' => 1, 'domain_spaces' => 2, 'data_retention_days' => 30, 'dedicated_ips' => 0)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
it 'returns the account without a WhatsApp add-on' do
|
|
36
|
+
VCR.use_cassette('account/account_get_without_whatsapp') do
|
|
37
|
+
data = JSON.parse(account.get_account.body)['data']
|
|
38
|
+
|
|
39
|
+
expect(data['addons']).to include('whatsapp' => nil)
|
|
40
|
+
expect(data['resources']).to include('free_accountant_seat' => { 'used' => 1, 'limit' => 1 }, 'webhooks' => { 'used' => 0, 'limit' => nil })
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'rspec'
|
|
4
|
+
|
|
5
|
+
RSpec.describe Mailersend::Client do
|
|
6
|
+
it 'defaults to the 2026-10 API version' do
|
|
7
|
+
client = Mailersend::Client.new(API_TOKEN)
|
|
8
|
+
|
|
9
|
+
expect(client.api_version).to eq('2026-10')
|
|
10
|
+
expect(client.api_path).to eq('/2026-10')
|
|
11
|
+
expect(client.api_base_url).to eq('https://api.mailersend.com/2026-10')
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
it 'can stay on v1' do
|
|
15
|
+
client = Mailersend::Client.new(API_TOKEN, api_version: 'v1')
|
|
16
|
+
|
|
17
|
+
expect(client.api_path).to eq('/v1')
|
|
18
|
+
expect(client.api_base_url).to eq('https://api.mailersend.com/v1')
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
it 'accepts another dated version' do
|
|
22
|
+
client = Mailersend::Client.new(API_TOKEN, api_version: '2027-04')
|
|
23
|
+
|
|
24
|
+
expect(client.api_path).to eq('/2027-04')
|
|
25
|
+
expect(client.api_base_url).to eq('https://api.mailersend.com/2027-04')
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
it 'raises on an invalid API version' do
|
|
29
|
+
['v2', '2026-13', '2026-1', '2026-10-01', '', nil].each do |api_version|
|
|
30
|
+
expect { Mailersend::Client.new(API_TOKEN, api_version: api_version) }.to raise_error(ArgumentError)
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
data/spec/emails_rspec.rb
CHANGED
|
@@ -115,7 +115,7 @@ RSpec.describe Mailersend::Emails do
|
|
|
115
115
|
status: %w[sent delivered], interaction: %w[opened clicked])
|
|
116
116
|
|
|
117
117
|
expect(requested_urls.last).to eq(
|
|
118
|
-
'https://api.mailersend.com/
|
|
118
|
+
'https://api.mailersend.com/2026-10/emails' \
|
|
119
119
|
'?domain_id=jpzkmgq7e5vl059v&date_from=1756252800&date_to=1756339200&limit=10&page=1' \
|
|
120
120
|
'&status%5B%5D=sent&status%5B%5D=delivered' \
|
|
121
121
|
'&interaction%5B%5D=opened&interaction%5B%5D=clicked'
|
|
@@ -132,7 +132,7 @@ RSpec.describe Mailersend::Emails do
|
|
|
132
132
|
status: 'sent', interaction: 'opened')
|
|
133
133
|
|
|
134
134
|
expect(requested_urls.last).to eq(
|
|
135
|
-
'https://api.mailersend.com/
|
|
135
|
+
'https://api.mailersend.com/2026-10/emails' \
|
|
136
136
|
'?domain_id=jpzkmgq7e5vl059v&date_from=1756252800&date_to=1756339200' \
|
|
137
137
|
'&status%5B%5D=sent&interaction%5B%5D=opened'
|
|
138
138
|
)
|
|
@@ -145,7 +145,7 @@ RSpec.describe Mailersend::Emails do
|
|
|
145
145
|
subject: 'Welcome', tag: 'newsletter')
|
|
146
146
|
|
|
147
147
|
expect(requested_urls.last).to eq(
|
|
148
|
-
'https://api.mailersend.com/
|
|
148
|
+
'https://api.mailersend.com/2026-10/emails' \
|
|
149
149
|
'?domain_id=jpzkmgq7e5vl059v&date_from=1756252800&date_to=1756339200&limit=25&page=2' \
|
|
150
150
|
'&status%5B%5D=sent&interaction%5B%5D=opened' \
|
|
151
151
|
'&recipient_email=rcpt%40example.org&message_id=6a8fa9b1902fab56e0ce50aa' \
|
|
@@ -157,7 +157,7 @@ RSpec.describe Mailersend::Emails do
|
|
|
157
157
|
emails.list(domain_id: domain_id, date_from: date_from, date_to: date_to)
|
|
158
158
|
|
|
159
159
|
expect(requested_urls.last).to eq(
|
|
160
|
-
'https://api.mailersend.com/
|
|
160
|
+
'https://api.mailersend.com/2026-10/emails?domain_id=jpzkmgq7e5vl059v&date_from=1756252800&date_to=1756339200'
|
|
161
161
|
)
|
|
162
162
|
|
|
163
163
|
%w[limit page status interaction recipient_email message_id template_id subject tag].each do |param|
|
|
@@ -165,11 +165,11 @@ RSpec.describe Mailersend::Emails do
|
|
|
165
165
|
end
|
|
166
166
|
end
|
|
167
167
|
|
|
168
|
-
it 'requests the singular
|
|
168
|
+
it 'requests the singular email/{id} path for a single email' do
|
|
169
169
|
emails.single(email_id: '6a8fa9b1902fab56e0ce50dd')
|
|
170
170
|
|
|
171
|
-
expect(requested_urls.last).to eq('https://api.mailersend.com/
|
|
172
|
-
expect(requested_urls.last).not_to include('/
|
|
171
|
+
expect(requested_urls.last).to eq('https://api.mailersend.com/2026-10/email/6a8fa9b1902fab56e0ce50dd')
|
|
172
|
+
expect(requested_urls.last).not_to include('/2026-10/emails/')
|
|
173
173
|
end
|
|
174
174
|
end
|
|
175
175
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mailersend-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nikola Milojević
|
|
@@ -77,6 +77,8 @@ files:
|
|
|
77
77
|
- Rakefile
|
|
78
78
|
- bin/console
|
|
79
79
|
- bin/setup
|
|
80
|
+
- fixtures/account/account_get.yml
|
|
81
|
+
- fixtures/account/account_get_without_whatsapp.yml
|
|
80
82
|
- fixtures/activity/activity_get_activity.yml
|
|
81
83
|
- fixtures/api_quota/api_quota_get.yml
|
|
82
84
|
- fixtures/bulk_email/bulk_email_send.yml
|
|
@@ -175,6 +177,7 @@ files:
|
|
|
175
177
|
- lefthook.yml
|
|
176
178
|
- lib/mailersend-ruby.rb
|
|
177
179
|
- lib/mailersend.rb
|
|
180
|
+
- lib/mailersend/account/account.rb
|
|
178
181
|
- lib/mailersend/activity/activity.rb
|
|
179
182
|
- lib/mailersend/analytics/analytics.rb
|
|
180
183
|
- lib/mailersend/api_quota/api_quota.rb
|
|
@@ -211,9 +214,11 @@ files:
|
|
|
211
214
|
- lib/mailersend/whatsapp_templates/whatsapp_templates.rb
|
|
212
215
|
- mailersend-ruby.gemspec
|
|
213
216
|
- renovate.json
|
|
217
|
+
- spec/account_rspec.rb
|
|
214
218
|
- spec/activity_rspec.rb
|
|
215
219
|
- spec/api_quota_rspec.rb
|
|
216
220
|
- spec/bulk_email_rspec.rb
|
|
221
|
+
- spec/client_rspec.rb
|
|
217
222
|
- spec/dmarc_monitoring_rspec.rb
|
|
218
223
|
- spec/domains_rspec.rb
|
|
219
224
|
- spec/email_rspec.rb
|