πŸ“¬ 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:

  1. Run bin/setup to install dependencies

  2. Create config/credentials.yml with your API credentials

  3. Run bin/console for an interactive prompt

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.