-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* develop: remove confusing sentence in README. emailable 4.0.0: switch all endpoints to use options hash arguments instead of keyword arguments. modify README to reflect these changes. upgrade pry gem version to fix warning. bump version to 4.0.0.
- Loading branch information
Showing
6 changed files
with
48 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,9 @@ Or install it yourself as: | |
|
||
## Usage | ||
|
||
The library needs to be configured with your account's API key which is available in your [Emailable Dashboard](https://app.emailable.com/api). Set `Emailable.api_key` to its value: | ||
The library needs to be configured with your account's API key which is | ||
available in your [Emailable Dashboard](https://app.emailable.com/api). Set | ||
`Emailable.api_key` to its value: | ||
|
||
### Setup | ||
|
||
|
@@ -47,6 +49,9 @@ Emailable.api_key = 'live_...' | |
Emailable.verify('[email protected]') | ||
``` | ||
|
||
All supported parameters for the verify endpoint can be passed in as hash | ||
arguments to the `verify` method. | ||
|
||
#### Slow Email Server Handling | ||
|
||
Some email servers are slow to respond. As a result, the timeout may be reached | ||
|
@@ -60,23 +65,29 @@ email `[email protected]`. | |
|
||
### Batch Verification | ||
|
||
First, create an `Emailable::Batch` object. Then, call the `verify` method to | ||
start the batch. All supported parameters for the batch verification endpoint | ||
can be passed in as hash arguments to the `verify` method. | ||
|
||
#### Start a batch | ||
|
||
```ruby | ||
emails = ['[email protected]', '[email protected]', ...] | ||
batch = Emailable::Batch.new(emails) | ||
|
||
# you can optionally pass in a callback url that we'll POST to when the | ||
# batch is complete. | ||
batch = Emailable::Batch.new(emails, callback: 'https://emailable.com/') | ||
|
||
# start verifying the batch | ||
batch.verify | ||
|
||
# you can optionally pass in a callback url that we'll POST to when the batch | ||
# is complete. | ||
batch.verify(url: 'https://emailable.com/') | ||
``` | ||
|
||
#### Get the status / results of a batch | ||
|
||
Calling `status` on a batch will return the status. It will contain the results as well once complete. You can also `results` to get just the results. | ||
Calling `status` on a batch will return the status. It will contain the results | ||
as well once complete. All supported parameters for the status endpoint can be | ||
passed in as hash arguments to the `status` method. | ||
|
||
```ruby | ||
id = '5cfcbfdeede34200693c4319' | ||
|
@@ -85,6 +96,9 @@ batch = Emailable::Batch.new(id) | |
# get status of batch | ||
batch.status | ||
|
||
# get the status of a batch, with partial results if the batch is incomplete | ||
batch.status(partial: true) | ||
|
||
# gets the results | ||
batch.status.emails | ||
|
||
|
@@ -126,10 +140,17 @@ attr_accessor :email_verification_result | |
|
||
## Development | ||
|
||
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. | ||
After checking out the repo, run `bin/setup` to install dependencies. Then, run | ||
`rake test` to run the tests. You can also run `bin/console` for an interactive | ||
prompt that will allow you to experiment. | ||
|
||
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). | ||
To install this gem onto your local machine, run `bundle exec rake install`. To | ||
release a new version, update the version number in `version.rb`, and then run | ||
`bundle exec rake release`, which will create a git tag for the version, push | ||
git commits and tags, and push the `.gem` file to | ||
[rubygems.org](https://rubygems.org). | ||
|
||
## Contributing | ||
|
||
Bug reports and pull requests are welcome on GitHub at https://github.com/emailable/emailable-ruby. | ||
Bug reports and pull requests are welcome on GitHub at | ||
https://github.com/emailable/emailable-ruby. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module Emailable | ||
VERSION = '3.2.0' | ||
VERSION = '4.0.0' | ||
end |