Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PM-1743. update Postmark Ruby gem to support CustomTracking #156

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/postmark/account_api_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
J0SUEFDZ marked this conversation as resolved.
Show resolved Hide resolved
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
Expand Down
2 changes: 1 addition & 1 deletion lib/postmark/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ def format_batch_response(response, name)
end

end
end
end
10 changes: 10 additions & 0 deletions spec/unit/postmark/account_api_client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,16 @@
end
end

describe '#verify_domain_custom_tracking' do
let(:response) { {"CustomTrackingVerified" => true } }

it 'performs a PUT request to /domains/:id/verify_domain_custom_tracking endpoint' do
J0SUEFDZ marked this conversation as resolved.
Show resolved Hide resolved
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} }
Expand Down