Skip to content

Commit

Permalink
Upgraded to v3 api endpoint
Browse files Browse the repository at this point in the history
Right now the gem is hard-coded to use the v2 api, but v3 is out.
According to mailgun, v3 is backwards compatible except for the bounces
endpoint, which the gem does not use (details here -
http://blog.mailgun.com/default-api-version-now-v3/).

This changes the (hard-coded) endpoint url from v2 to v3. Possibly
solving jorgemanrubia#34.
  • Loading branch information
iainbeeston committed Apr 1, 2015
1 parent 04ee1c1 commit cb23838
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/mailgun/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def mailgun_url
end

def api_url
"https://api:#{api_key}@api.mailgun.net/v2/#{domain}"
"https://api:#{api_key}@api.mailgun.net/v3/#{domain}"
end
end
end
end
4 changes: 2 additions & 2 deletions spec/lib/mailgun/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

describe "#send_message" do
it 'should make a POST rest request passing the parameters to the mailgun end point' do
expected_url = "https://api:[email protected]/v2/some_domain/messages"
expected_url = "https://api:[email protected]/v3/some_domain/messages"
RestClient.should_receive(:post).with(expected_url, foo: :bar)
client.send_message foo: :bar
end
end
end
end

0 comments on commit cb23838

Please sign in to comment.