This is the ruby client for SMTP Locaweb product.
Add this line to your application's Gemfile:
gem 'smtp_lw'
And then execute:
$ bundle
Or install it yourself as:
$ gem install smtp_lw
client = SmtpLw::Client.new(api_token: 'your api token from the panel')
or
SmtpLw.configure do |c|
c.api_token = 'your api token'
c.per_page = 50
end
# instanciate the client
client = SmtpLw::Client.new
Alternatively you can authenticate setting an ENV:
SMTP_LW_API_TOKEN='your api token'
and then:
client = SmtpLw::Client.new
client.list_messages('all', '2015-07-01', '2015-07-30')
You can pass options as specified in the API documentation:
client.list_messages('all', '2015-07-01', '2015-07-30' {page: 1, per: 50})
client.send_message("meeting tomorrow at 11", "this is the body of my msg", '[email protected]',
'[email protected]')
- Fork it ( https://github.com/[my-github-username]/smtp_lw/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request