Project

smtp_lw

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
This is the ruby client for SMTP Locaweb product.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

SmtpLw

This is the ruby client for SMTP Locaweb product.

Installation

gem install smtp_lw

or add this line to Gemfile:

gem 'smtp_lw'

and run bundle install from your shell.

Usage

Authentication and Configuration

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

# instantiate the client
client = SmtpLw::Client.new

You can also authenticate setting an environment variable

SMTP_LW_API_TOKEN='your api token'

and then use the client

client = SmtpLw::Client.new

Retrieving messages for a given period

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})

Sending a message

client.send_message('meeting tomorrow at 11', 'this is the body of my msg', 'me@domain.com',
'you@domain.com')

Contributing

Please see CONTRIBUTING.md.

License

smtp_lw is Copyright © 2015-2016 Locaweb. It is free software, and may be redistributed under the terms specified in the LICENSE file.