diff --git a/lib/postmark/account_api_client.rb b/lib/postmark/account_api_client.rb index 8ab79d8..65e3492 100644 --- a/lib/postmark/account_api_client.rb +++ b/lib/postmark/account_api_client.rb @@ -98,6 +98,10 @@ def verify_domain_return_path(id) format_response http_client.put("domains/#{id.to_i}/verifyreturnpath") end + def verify_domain_custom_tracking(id) + format_response http_client.put("domains/#{id.to_i}/verifycustomtracking") + end + def verified_domain_spf?(id) !!http_client.post("domains/#{id.to_i}/verifyspf")['SPFVerified'] end diff --git a/spec/unit/postmark/account_api_client_spec.rb b/spec/unit/postmark/account_api_client_spec.rb index 408a221..c1d9dd3 100644 --- a/spec/unit/postmark/account_api_client_spec.rb +++ b/spec/unit/postmark/account_api_client_spec.rb @@ -448,6 +448,16 @@ end end + describe '#verify_domain_custom_tracking' do + let(:response) { {"CustomTrackingVerified" => true } } + + it 'performs a PUT request to /domains/:id/verifycustomtracking endpoint' do + expect(subject.http_client).to receive(:put). + with('domains/42/verifycustomtracking').and_return(response) + subject.verify_domain_custom_tracking(42) + end + end + describe '#verified_domain_spf?' do let(:response) { {"SPFVerified" => true} } let(:false_response) { {"SPFVerified" => false} }