https://github.com/rubyonworld/mailerlite-ruby
A Ruby gem which helps to communicate with MailerLite API.
https://github.com/rubyonworld/mailerlite-ruby
api communicate gem lite miler ruby
Last synced: 2 months ago
JSON representation
A Ruby gem which helps to communicate with MailerLite API.
- Host: GitHub
- URL: https://github.com/rubyonworld/mailerlite-ruby
- Owner: RubyOnWorld
- License: mit
- Created: 2022-09-27T15:29:31.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-09-04T15:18:09.000Z (almost 3 years ago)
- Last Synced: 2025-06-04T08:20:32.457Z (about 1 year ago)
- Topics: api, communicate, gem, lite, miler, ruby
- Language: Ruby
- Homepage:
- Size: 150 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# MailerLite API v2 Ruby wrapper
A Ruby gem which helps to communicate with [MailerLite][mailerlite] API.
[][rubygems]
[][codecov]
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'mailerlite'
```
## Usage
Before making any request, you should authenticate first. Use the response object to
make requests afterward.
See [create a campaign][create_a_campaign] example.
### Authentication
When you sign up for an account, you are given an **API key**. You authenticate to
the [MailerLite][mailerlite] API by providing your API key in the request.
You can find your API key in page: Integrations » Developer API.
```ruby
client = MailerLite::Client.new(api_key: 'my-secret-api-key')
```
Example:
```ruby
client.groups
```
Or create file under `config/initializers/mailerlite.rb`
```ruby
MailerLite.configure do |config|
config.api_key = 'my-secret-api-key'
# config.timeout = 10
end
```
When you configured global settings in file, then you can request methods
on `MailerLite` class directly.
Example:
```ruby
MailerLite.campaigns
```
See more documentation in [examples][examples] directory.
## Supported Ruby Versions
This library aims to support and is [tested against][github_actions] the following Ruby
implementations:
* Ruby 2.6.0
* Ruby 2.7.0
* Ruby 3.0.0
* Ruby 3.1.0
* Truffleruby
## License
The gem is available as open source under the terms of the [MIT License][license].
[rubygems]: https://rubygems.org/gems/mailerlite
[codecov]: https://codecov.io/gh/jpalumickas/mailerlite-ruby
[github_actions]: https://github.com/jpalumickas/mailerlite-ruby/actions
[license]: https://raw.githubusercontent.com/jpalumickas/mailerlite-ruby/master/LICENSE
[create_a_campaign]: https://raw.githubusercontent.com/jpalumickas/mailerlite-ruby/master/examples/create_campaign.md
[examples]: https://github.com/jpalumickas/mailerlite-ruby/tree/master/examples
[mailerlite]: https://www.mailerlite.com