The project is in a healthy, maintained state
Full Ruby wrapper for Mailganer email API, FBL, stop-list, statistics.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

>= 0
 Project Readme

Mailganer Client

A simple Ruby client for the Mailganer API.
Designed to make sending requests and integrating with the service effortless.

🚀 Installation

Add this line to your application's Gemfile:

gem "mailganer-client"

Then install:

bundle install

Or install it manually:

gem install mailganer-client

📦 Usage

require "mailganer_client"

MailganerClient.configure do |config|
  config.api_key = "your-smtp-api-key"
  config.smtp_login = "xxx"
  config.api_key_web_portal = "your-web-portal-api-key"
end

client = MailganerClient.new

response = client.send_email(
  to: "user@example.com",
  from: "info@mysite.com",
  subject: "Hello!",
  body: "Your message goes here"
)

puts response
response = client.get_fbl_report_by_date(date_from: "2020-01-01", date_to: "2026-01-01")

puts response
response = client.send_email_smtp_v1(
    type: 'template',
    to: "test@test.com",
    subject: "subject",
    template_id: "template_id from mailganer web portal",
    params:  {
      name: 'Test name',
      unsubscribeUrl: ''
    },
    from: "from@mysite.com",
    name_from: "Sender name from@mysite.com"
  )

puts response
#file_path = Rails.root.join('app', 'javascript', 'src', 'public', 'img', 'test-image.jpg')
#file_path = File.expand_path("test-image.jpg", __dir__)
require 'base64'

response = client.send_email_smtp_v1(
    type: 'template',
    to: "test@test.com",
    subject: "subject",
    template_id: "template_id from mailganer web portal",
    params:  {
      name: 'Test name'
    },
    from: "from@mysite.com",
    body: "Hello, {{name}}",  
    name_from: "Sender name from@mysite.com",
    attach_files: [
        {
          name: File.basename("file_path"),
          filebody: Base64.strict_encode64(File.read("file_path"))
        }
      ]
    )

puts response

⚙️ Configuration

MailganerClient.configure do |config|
  config.api_key: "your-smtp-api-key",
  config.smtp_login: "xxx",
  config.api_key_web_portal: "your-web-portal-api-key"
end

## 🏗 Development

``` bash
git clone https://github.com/yetisamurai/mailganer_client.git
cd mailganer_client