π¬ Rapidmail
A Ruby wrapper for the Rapidmail API V3. This gem provides an easy-to-use interface for interacting with the Rapidmail newsletter service API.
π Table of Contents
π Installation
Add this line to your applicationβs Gemfile:
gem 'rapidmail'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install rapidmail
βοΈ Configuration
Configure Rapidmail with your credentials:
Rapidmail.configure do |config|
config.username = 'your_username'
config.password = 'your_password'
end
Or load configuration from an YAML file:
Rapidmail::Utils::ConfigLoader.load('path/to/your/config.yml')
π¨ Usage
Basic Usage (Example)
# Initialize client
client = Rapidmail.client
# List mailings
client.mailings.list
# Find specific mailing
client.mailings.find(123)
# Create mailing
client.mailings.create(params)
# Delete mailing
client.mailings.destroy(123)
Working with ZIP Files
# Encode files for upload
files = {
"newsletter.txt" => "Hello, World!",
"newsletter.html" => "<p>Hello, World!</p>"
}
encoded_data = Rapidmail::Utils::ZipEncoder.encode(files)
β‘ Rails Integration (optional)
To set up Rapidmail in a Rails application:
rails generate rapidmail:install
This will create an initializer at config/initializers/rapidmail.rb
π Documentation
Full documentation is available at cortona.github.io/rapidmail-ruby/
π» Development
After checking out the repo:
-
Run
bin/setup
to install dependencies -
Create
config/credentials.yml
with your API credentials -
Run
bin/console
for an interactive prompt
π License
This project is licensed under the MIT License - see the LICENSE file for details.