mailersend-ruby 3.0.1 → 3.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 17f9c7e1443d5719db627034223fe14c686120821832531d97ba1bddfd9baa3d
4
- data.tar.gz: d796dcdb8473272add457f118eb3ec0db7f671d79a5cc58c682c5544bad95753
3
+ metadata.gz: 9b3bfbc4f6cab77294426741f5420ade91c52721573bd3885d384ccbcceb9045
4
+ data.tar.gz: e9c86c9b59c128fb303c7a28c39282d17b4c14f27c1503ed8495098e16387b45
5
5
  SHA512:
6
- metadata.gz: db2485ea6a3e44cdd2be3609ab515cc2c71192da8256dcb31d55f3d96e60324e9be5c8c378c2b6cea203b8b98ad7df30bdafc4bb4722cd7e5b52344dc2371e4b
7
- data.tar.gz: cbbead7b4a7b9dc7c9d51af70bcad38f3e4915506ecd9deb2428b41b9496cef5b1fb4158c5426bc4ddfa8eee1be5c5c481c15a85792398ef1cbd575080380fa3
6
+ metadata.gz: 24128c89d8b0206843c001f438c6258acb29a9319ffa63819c7d4390040efb9b344402442af1379dad411e16724abe3f021eb4b1029e2607a26026cfb87cd24e
7
+ data.tar.gz: 05652e0beb32b924ad15e2c3f251ac3b5659853172d1bdafa35c8ad4d01d0e558b4c06744285bd5a7830ff51fdc388706a5dd3013dbfd846d6471606ad90886d
@@ -6,7 +6,7 @@ jobs:
6
6
  build:
7
7
  runs-on: ubuntu-latest
8
8
  steps:
9
- - uses: actions/checkout@v4
9
+ - uses: actions/checkout@v6
10
10
 
11
11
  - name: Set up Ruby
12
12
  uses: ruby/setup-ruby@v1
@@ -9,7 +9,7 @@ jobs:
9
9
  runs-on: ubuntu-latest
10
10
 
11
11
  steps:
12
- - uses: actions/checkout@v4
12
+ - uses: actions/checkout@v6
13
13
 
14
14
  - name: Set up Ruby
15
15
  uses: ruby/setup-ruby@v1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  ## [Released]
2
2
 
3
+ ## [3.1.0] - 2026-04-24
4
+ - DMARC Monitoring support (list, create, update, delete monitors; aggregated reports, IP-specific reports, report sources, mark/remove IP favorites)
5
+
3
6
  ## [3.0.1] - 2025-04-10
4
7
  - Adding missing parameters
5
8
 
data/README.md CHANGED
@@ -42,6 +42,16 @@ MailerSend Ruby SDK
42
42
  - [Update domain settings](#update-domain-settings)
43
43
  - [Get DNS Records](#get-dns-records)
44
44
  - [Get verification status](#get-verification-status)
45
+ - [DMARC Monitoring](#dmarc-monitoring)
46
+ - [Get a list of monitors](#get-a-list-of-monitors)
47
+ - [Create a monitor](#create-a-monitor)
48
+ - [Update a monitor](#update-a-monitor)
49
+ - [Delete a monitor](#delete-a-monitor)
50
+ - [Get aggregated reports](#get-aggregated-reports)
51
+ - [Get IP-specific reports](#get-ip-specific-reports)
52
+ - [Get report sources](#get-report-sources)
53
+ - [Mark IP as favorite](#mark-ip-as-favorite)
54
+ - [Remove IP from favorites](#remove-ip-from-favorites)
45
55
  - [Sender Identities](#sender-identities)
46
56
  - [Get a list of sender identities](#get-a-list-of-sender-identities)
47
57
  - [Get a single sender identity](#get-a-single-sender-identity)
@@ -544,6 +554,107 @@ ms_domains = Mailersend::Domains.new(ms_client)
544
554
  ms_domains.verify(domain_id: "idofdomain12412")
545
555
  ```
546
556
 
557
+ ## DMARC Monitoring
558
+
559
+ ### Get a list of monitors
560
+
561
+ ```ruby
562
+ require "mailersend-ruby"
563
+
564
+ ms_client = Mailersend::Client.new('your_mailersend_token')
565
+
566
+ ms_dmarc = Mailersend::DmarcMonitoring.new(ms_client)
567
+ ms_dmarc.list
568
+ ```
569
+
570
+ ### Create a monitor
571
+
572
+ ```ruby
573
+ require "mailersend-ruby"
574
+
575
+ ms_client = Mailersend::Client.new('your_mailersend_token')
576
+
577
+ ms_dmarc = Mailersend::DmarcMonitoring.new(ms_client)
578
+ ms_dmarc.create(domain_id: "idofdomain12412")
579
+ ```
580
+
581
+ ### Update a monitor
582
+
583
+ ```ruby
584
+ require "mailersend-ruby"
585
+
586
+ ms_client = Mailersend::Client.new('your_mailersend_token')
587
+
588
+ ms_dmarc = Mailersend::DmarcMonitoring.new(ms_client)
589
+ ms_dmarc.update(monitor_id: "idofmonitor12412", wanted_dmarc_record: "v=DMARC1; p=reject;")
590
+ ```
591
+
592
+ ### Delete a monitor
593
+
594
+ ```ruby
595
+ require "mailersend-ruby"
596
+
597
+ ms_client = Mailersend::Client.new('your_mailersend_token')
598
+
599
+ ms_dmarc = Mailersend::DmarcMonitoring.new(ms_client)
600
+ ms_dmarc.delete(monitor_id: "idofmonitor12412")
601
+ ```
602
+
603
+ ### Get aggregated reports
604
+
605
+ ```ruby
606
+ require "mailersend-ruby"
607
+
608
+ ms_client = Mailersend::Client.new('your_mailersend_token')
609
+
610
+ ms_dmarc = Mailersend::DmarcMonitoring.new(ms_client)
611
+ ms_dmarc.report(monitor_id: "idofmonitor12412")
612
+ ```
613
+
614
+ ### Get IP-specific reports
615
+
616
+ ```ruby
617
+ require "mailersend-ruby"
618
+
619
+ ms_client = Mailersend::Client.new('your_mailersend_token')
620
+
621
+ ms_dmarc = Mailersend::DmarcMonitoring.new(ms_client)
622
+ ms_dmarc.report_by_ip(monitor_id: "idofmonitor12412", ip: "1.2.3.4")
623
+ ```
624
+
625
+ ### Get report sources
626
+
627
+ ```ruby
628
+ require "mailersend-ruby"
629
+
630
+ ms_client = Mailersend::Client.new('your_mailersend_token')
631
+
632
+ ms_dmarc = Mailersend::DmarcMonitoring.new(ms_client)
633
+ ms_dmarc.report_sources(monitor_id: "idofmonitor12412")
634
+ ```
635
+
636
+ ### Mark IP as favorite
637
+
638
+ ```ruby
639
+ require "mailersend-ruby"
640
+
641
+ ms_client = Mailersend::Client.new('your_mailersend_token')
642
+
643
+ ms_dmarc = Mailersend::DmarcMonitoring.new(ms_client)
644
+ ms_dmarc.add_favorite(monitor_id: "idofmonitor12412", ip: "1.2.3.4")
645
+ ```
646
+
647
+ ### Remove IP from favorites
648
+
649
+ ```ruby
650
+ require "mailersend-ruby"
651
+
652
+ ms_client = Mailersend::Client.new('your_mailersend_token')
653
+
654
+ ms_dmarc = Mailersend::DmarcMonitoring.new(ms_client)
655
+ ms_dmarc.remove_favorite(monitor_id: "idofmonitor12412", ip: "1.2.3.4")
656
+ ```
657
+
547
658
  ## Sender Identities
548
659
 
549
660
  ### Get a list of sender identities
@@ -0,0 +1,31 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: https://api.mailersend.com/v1/dmarc-monitoring/example_monitor_id/favorite/1.2.3.4
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ Authorization:
11
+ - "<AUTH>"
12
+ User-Agent:
13
+ - MailerSend-client-ruby/3.0.1
14
+ Accept:
15
+ - application/json
16
+ Connection:
17
+ - close
18
+ Host:
19
+ - api.mailersend.com
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Content-Type:
26
+ - application/json
27
+ body:
28
+ encoding: UTF-8
29
+ string: ''
30
+ recorded_at: Mon, 01 Jan 2024 00:00:00 GMT
31
+ recorded_with: VCR 6.3.1
@@ -0,0 +1,34 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.mailersend.com/v1/dmarc-monitoring
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"domain_id":"example_domain_id"}'
9
+ headers:
10
+ Authorization:
11
+ - "<AUTH>"
12
+ User-Agent:
13
+ - MailerSend-client-ruby/3.0.1
14
+ Accept:
15
+ - application/json
16
+ Connection:
17
+ - close
18
+ Content-Type:
19
+ - application/json; charset=utf-8
20
+ Host:
21
+ - api.mailersend.com
22
+ response:
23
+ status:
24
+ code: 201
25
+ message: Created
26
+ headers:
27
+ Content-Type:
28
+ - application/json
29
+ body:
30
+ encoding: UTF-8
31
+ string: '{"data":{"id":"example_monitor_id","dmarc_record":"v=DMARC1; p=none;","wanted_dmarc_record":null,"dmarc_record_valid":false,"spf_record":"v=spf1
32
+ include:spf.example.com ~all","spf_record_valid":true,"domain":{"id":"example_domain_id","name":"example.com"},"created_at":"2024-01-01T00:00:00.000000Z","updated_at":"2024-01-01T00:00:00.000000Z"}}'
33
+ recorded_at: Mon, 01 Jan 2024 00:00:00 GMT
34
+ recorded_with: VCR 6.3.1
@@ -0,0 +1,31 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: delete
5
+ uri: https://api.mailersend.com/v1/dmarc-monitoring/example_monitor_id
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ Authorization:
11
+ - "<AUTH>"
12
+ User-Agent:
13
+ - MailerSend-client-ruby/3.0.1
14
+ Accept:
15
+ - application/json
16
+ Connection:
17
+ - close
18
+ Host:
19
+ - api.mailersend.com
20
+ response:
21
+ status:
22
+ code: 204
23
+ message: No Content
24
+ headers:
25
+ Content-Type:
26
+ - application/json
27
+ body:
28
+ encoding: UTF-8
29
+ string: ''
30
+ recorded_at: Mon, 01 Jan 2024 00:00:00 GMT
31
+ recorded_with: VCR 6.3.1
@@ -0,0 +1,32 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.mailersend.com/v1/dmarc-monitoring
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ Authorization:
11
+ - "<AUTH>"
12
+ User-Agent:
13
+ - MailerSend-client-ruby/3.0.1
14
+ Accept:
15
+ - application/json
16
+ Connection:
17
+ - close
18
+ Host:
19
+ - api.mailersend.com
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Content-Type:
26
+ - application/json
27
+ body:
28
+ encoding: UTF-8
29
+ string: '{"data":[{"id":"example_monitor_id","dmarc_record":"v=DMARC1; p=none;","wanted_dmarc_record":"v=DMARC1;
30
+ p=reject;","dmarc_record_valid":false,"spf_record":"v=spf1 include:spf.example.com ~all","spf_record_valid":true,"domain":{"id":"example_domain_id","name":"example.com"},"created_at":"2024-01-01T00:00:00.000000Z","updated_at":"2024-01-01T00:00:00.000000Z"}]}'
31
+ recorded_at: Mon, 01 Jan 2024 00:00:00 GMT
32
+ recorded_with: VCR 6.3.1
@@ -0,0 +1,31 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: delete
5
+ uri: https://api.mailersend.com/v1/dmarc-monitoring/example_monitor_id/favorite/1.2.3.4
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ Authorization:
11
+ - "<AUTH>"
12
+ User-Agent:
13
+ - MailerSend-client-ruby/3.0.1
14
+ Accept:
15
+ - application/json
16
+ Connection:
17
+ - close
18
+ Host:
19
+ - api.mailersend.com
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Content-Type:
26
+ - application/json
27
+ body:
28
+ encoding: UTF-8
29
+ string: ''
30
+ recorded_at: Mon, 01 Jan 2024 00:00:00 GMT
31
+ recorded_with: VCR 6.3.1
@@ -0,0 +1,31 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.mailersend.com/v1/dmarc-monitoring/example_monitor_id/report
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ Authorization:
11
+ - "<AUTH>"
12
+ User-Agent:
13
+ - MailerSend-client-ruby/3.0.1
14
+ Accept:
15
+ - application/json
16
+ Connection:
17
+ - close
18
+ Host:
19
+ - api.mailersend.com
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Content-Type:
26
+ - application/json
27
+ body:
28
+ encoding: UTF-8
29
+ string: '{"data":[{"ip":"1.2.3.4","dmarc_pass_rate":95,"spf_pass_rate":98,"dkim_pass_rate":97,"message_count":1000,"is_favorite":false,"country":"US"}]}'
30
+ recorded_at: Mon, 01 Jan 2024 00:00:00 GMT
31
+ recorded_with: VCR 6.3.1
@@ -0,0 +1,31 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.mailersend.com/v1/dmarc-monitoring/example_monitor_id/report/1.2.3.4
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ Authorization:
11
+ - "<AUTH>"
12
+ User-Agent:
13
+ - MailerSend-client-ruby/3.0.1
14
+ Accept:
15
+ - application/json
16
+ Connection:
17
+ - close
18
+ Host:
19
+ - api.mailersend.com
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Content-Type:
26
+ - application/json
27
+ body:
28
+ encoding: UTF-8
29
+ string: '{"data":[{"source_name":"google.com","message_count":500,"dmarc_pass":490,"spf_pass":495,"dkim_pass":492,"policy_applied":"none","disposition":"none","date":"2024-01-01"}]}'
30
+ recorded_at: Mon, 01 Jan 2024 00:00:00 GMT
31
+ recorded_with: VCR 6.3.1
@@ -0,0 +1,31 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.mailersend.com/v1/dmarc-monitoring/example_monitor_id/report-sources
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ Authorization:
11
+ - "<AUTH>"
12
+ User-Agent:
13
+ - MailerSend-client-ruby/3.0.1
14
+ Accept:
15
+ - application/json
16
+ Connection:
17
+ - close
18
+ Host:
19
+ - api.mailersend.com
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Content-Type:
26
+ - application/json
27
+ body:
28
+ encoding: UTF-8
29
+ string: '{"data":[{"name":"google.com","report_count":12},{"name":"yahoo.com","report_count":5}]}'
30
+ recorded_at: Mon, 01 Jan 2024 00:00:00 GMT
31
+ recorded_with: VCR 6.3.1
@@ -0,0 +1,34 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: https://api.mailersend.com/v1/dmarc-monitoring/example_monitor_id
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"wanted_dmarc_record":"v=DMARC1; p=reject;"}'
9
+ headers:
10
+ Authorization:
11
+ - "<AUTH>"
12
+ User-Agent:
13
+ - MailerSend-client-ruby/3.0.1
14
+ Accept:
15
+ - application/json
16
+ Connection:
17
+ - close
18
+ Content-Type:
19
+ - application/json; charset=utf-8
20
+ Host:
21
+ - api.mailersend.com
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Content-Type:
28
+ - application/json
29
+ body:
30
+ encoding: UTF-8
31
+ string: '{"data":{"id":"example_monitor_id","dmarc_record":"v=DMARC1; p=none;","wanted_dmarc_record":"v=DMARC1;
32
+ p=reject;","dmarc_record_valid":false,"spf_record":"v=spf1 include:spf.example.com ~all","spf_record_valid":true,"domain":{"id":"example_domain_id","name":"example.com"},"created_at":"2024-01-01T00:00:00.000000Z","updated_at":"2024-01-02T00:00:00.000000Z"}}'
33
+ recorded_at: Mon, 01 Jan 2024 00:00:00 GMT
34
+ recorded_with: VCR 6.3.1
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mailersend
4
+ # DMARC Monitoring endpoint from MailerSend API.
5
+ class DmarcMonitoring
6
+ attr_accessor :client, :monitor_id, :ip, :page, :limit
7
+
8
+ def initialize(client = Mailersend::Client.new)
9
+ @client = client
10
+ end
11
+
12
+ def list(page: nil, limit: nil)
13
+ hash = { 'page' => page, 'limit' => limit }
14
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST,
15
+ path: '/v1/dmarc-monitoring',
16
+ query: URI.encode_www_form(hash.compact)))
17
+ end
18
+
19
+ def create(domain_id:)
20
+ client.http.post("#{MAILERSEND_API_URL}/dmarc-monitoring",
21
+ json: { 'domain_id' => domain_id })
22
+ end
23
+
24
+ def update(monitor_id:, wanted_dmarc_record:)
25
+ client.http.put("#{MAILERSEND_API_URL}/dmarc-monitoring/#{monitor_id}",
26
+ json: { 'wanted_dmarc_record' => wanted_dmarc_record })
27
+ end
28
+
29
+ def delete(monitor_id:)
30
+ client.http.delete("#{MAILERSEND_API_URL}/dmarc-monitoring/#{monitor_id}")
31
+ end
32
+
33
+ def report(monitor_id:, page: nil, limit: nil)
34
+ hash = { 'page' => page, 'limit' => limit }
35
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST,
36
+ path: "/v1/dmarc-monitoring/#{monitor_id}/report",
37
+ query: URI.encode_www_form(hash.compact)))
38
+ end
39
+
40
+ def report_by_ip(monitor_id:, ip:, page: nil, limit: nil)
41
+ hash = { 'page' => page, 'limit' => limit }
42
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST,
43
+ path: "/v1/dmarc-monitoring/#{monitor_id}/report/#{ip}",
44
+ query: URI.encode_www_form(hash.compact)))
45
+ end
46
+
47
+ def report_sources(monitor_id:)
48
+ client.http.get("#{MAILERSEND_API_URL}/dmarc-monitoring/#{monitor_id}/report-sources")
49
+ end
50
+
51
+ def add_favorite(monitor_id:, ip:)
52
+ client.http.put("#{MAILERSEND_API_URL}/dmarc-monitoring/#{monitor_id}/favorite/#{ip}")
53
+ end
54
+
55
+ def remove_favorite(monitor_id:, ip:)
56
+ client.http.delete("#{MAILERSEND_API_URL}/dmarc-monitoring/#{monitor_id}/favorite/#{ip}")
57
+ end
58
+ end
59
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mailersend
4
- VERSION = '3.0.1'
4
+ VERSION = '3.1.0'
5
5
  end
data/lib/mailersend.rb CHANGED
@@ -6,6 +6,7 @@ require_relative 'mailersend/activity/activity'
6
6
  require_relative 'mailersend/api_quota/api_quota'
7
7
  require_relative 'mailersend/analytics/analytics'
8
8
  require_relative 'mailersend/bulk_email/bulk_email'
9
+ require_relative 'mailersend/dmarc_monitoring/dmarc_monitoring'
9
10
  require_relative 'mailersend/domains/domains'
10
11
  require_relative 'mailersend/email/email'
11
12
  require_relative 'mailersend/email_verification/email_verification'
@@ -0,0 +1,100 @@
1
+ require 'rspec'
2
+ require 'vcr'
3
+ require 'json'
4
+
5
+ VCR.configure do |config|
6
+ config.cassette_library_dir = './fixtures'
7
+ config.hook_into :webmock
8
+ config.filter_sensitive_data('<AUTH>') do |interaction|
9
+ interaction.request.headers['Authorization'][0]
10
+ end
11
+ end
12
+
13
+ RSpec.describe Mailersend::DmarcMonitoring do
14
+ let(:client) { Mailersend::Client.new(API_TOKEN) }
15
+ let(:dmarc) { Mailersend::DmarcMonitoring.new(client) }
16
+
17
+ it 'returns a list of monitors' do
18
+ VCR.use_cassette('dmarc_monitoring/list') do
19
+ response = dmarc.list
20
+ parsed_response = JSON.parse(response.body)
21
+
22
+ expect(response.status).to eq(200)
23
+ expect(parsed_response['data']).to be_an(Array)
24
+ end
25
+ end
26
+
27
+ it 'creates a monitor' do
28
+ VCR.use_cassette('dmarc_monitoring/create') do
29
+ response = dmarc.create(domain_id: 'example_domain_id')
30
+ parsed_response = JSON.parse(response.body)
31
+
32
+ expect(response.status).to eq(201)
33
+ expect(parsed_response['data']).to be_a(Hash)
34
+ end
35
+ end
36
+
37
+ it 'updates a monitor' do
38
+ VCR.use_cassette('dmarc_monitoring/update') do
39
+ response = dmarc.update(monitor_id: 'example_monitor_id', wanted_dmarc_record: 'v=DMARC1; p=reject;')
40
+ parsed_response = JSON.parse(response.body)
41
+
42
+ expect(response.status).to eq(200)
43
+ expect(parsed_response['data']).to be_a(Hash)
44
+ end
45
+ end
46
+
47
+ it 'deletes a monitor' do
48
+ VCR.use_cassette('dmarc_monitoring/delete') do
49
+ response = dmarc.delete(monitor_id: 'example_monitor_id')
50
+
51
+ expect(response.status).to eq(204)
52
+ end
53
+ end
54
+
55
+ it 'returns aggregated report' do
56
+ VCR.use_cassette('dmarc_monitoring/report') do
57
+ response = dmarc.report(monitor_id: 'example_monitor_id')
58
+ parsed_response = JSON.parse(response.body)
59
+
60
+ expect(response.status).to eq(200)
61
+ expect(parsed_response['data']).to be_an(Array)
62
+ end
63
+ end
64
+
65
+ it 'returns IP-specific report' do
66
+ VCR.use_cassette('dmarc_monitoring/report_by_ip') do
67
+ response = dmarc.report_by_ip(monitor_id: 'example_monitor_id', ip: '1.2.3.4')
68
+ parsed_response = JSON.parse(response.body)
69
+
70
+ expect(response.status).to eq(200)
71
+ expect(parsed_response['data']).to be_an(Array)
72
+ end
73
+ end
74
+
75
+ it 'returns report sources' do
76
+ VCR.use_cassette('dmarc_monitoring/report_sources') do
77
+ response = dmarc.report_sources(monitor_id: 'example_monitor_id')
78
+ parsed_response = JSON.parse(response.body)
79
+
80
+ expect(response.status).to eq(200)
81
+ expect(parsed_response['data']).to be_an(Array)
82
+ end
83
+ end
84
+
85
+ it 'marks an IP as favorite' do
86
+ VCR.use_cassette('dmarc_monitoring/add_favorite') do
87
+ response = dmarc.add_favorite(monitor_id: 'example_monitor_id', ip: '1.2.3.4')
88
+
89
+ expect(response.status).to eq(200)
90
+ end
91
+ end
92
+
93
+ it 'removes an IP from favorites' do
94
+ VCR.use_cassette('dmarc_monitoring/remove_favorite') do
95
+ response = dmarc.remove_favorite(monitor_id: 'example_monitor_id', ip: '1.2.3.4')
96
+
97
+ expect(response.status).to eq(200)
98
+ end
99
+ end
100
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailersend-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nikola Milojević
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-04-10 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: http
@@ -79,6 +79,15 @@ files:
79
79
  - fixtures/api_quota/api_quota_get.yml
80
80
  - fixtures/bulk_email/bulk_email_send.yml
81
81
  - fixtures/bulk_email/bulk_email_status.yml
82
+ - fixtures/dmarc_monitoring/add_favorite.yml
83
+ - fixtures/dmarc_monitoring/create.yml
84
+ - fixtures/dmarc_monitoring/delete.yml
85
+ - fixtures/dmarc_monitoring/list.yml
86
+ - fixtures/dmarc_monitoring/remove_favorite.yml
87
+ - fixtures/dmarc_monitoring/report.yml
88
+ - fixtures/dmarc_monitoring/report_by_ip.yml
89
+ - fixtures/dmarc_monitoring/report_sources.yml
90
+ - fixtures/dmarc_monitoring/update.yml
82
91
  - fixtures/domains/domains_add.yml
83
92
  - fixtures/domains/domains_delete.yml
84
93
  - fixtures/domains/domains_dns.yml
@@ -147,6 +156,7 @@ files:
147
156
  - lib/mailersend/api_quota/api_quota.rb
148
157
  - lib/mailersend/bulk_email/bulk_email.rb
149
158
  - lib/mailersend/client.rb
159
+ - lib/mailersend/dmarc_monitoring/dmarc_monitoring.rb
150
160
  - lib/mailersend/domains/domains.rb
151
161
  - lib/mailersend/email/email.rb
152
162
  - lib/mailersend/email_verification/email_verification.rb
@@ -172,6 +182,7 @@ files:
172
182
  - spec/activity_rspec.rb
173
183
  - spec/api_quota_rspec.rb
174
184
  - spec/bulk_email_rspec.rb
185
+ - spec/dmarc_monitoring_rspec.rb
175
186
  - spec/domains_rspec.rb
176
187
  - spec/email_rspec.rb
177
188
  - spec/inbound_routing_rspec.rb
@@ -212,7 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
212
223
  - !ruby/object:Gem::Version
213
224
  version: '0'
214
225
  requirements: []
215
- rubygems_version: 3.6.2
226
+ rubygems_version: 3.6.9
216
227
  specification_version: 4
217
228
  summary: MailerSend's official Ruby SDK
218
229
  test_files: []