The project is in a healthy, maintained state
Drop-in ActionMailer adapter to send emails via Customer.io
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

>= 0

Runtime

>= 7.0.0
>= 6.2.0
 Project Readme

Customer.io Rails Gem

License Gem Version

The customerio-rails gem is a drop-in ActionMailer adapter to send emails via Customer.io. The gem has been created for fast implementation and targets Customer.io’s transactional email capabilities.

Usage

Requirements

You will need a Customer.io account set up to use it.

Supported Rails Versions

  • Rails 8.0
  • Rails 7.0

App API Key

Generate an App API Key (this is different than the pair Site ID / API Key) from your Workspace Settings > Your Workspace > Manage API Credentials > App API Keys.

Installation

Add customerio-rails to your Gemfile and run bundle install.

gem 'customerio-rails'

Set Customer.io as your preferred mail delivery method via config/application.rb:

config.action_mailer.delivery_method = :customerio
config.action_mailer.customerio_settings = { app_api_key: '<Your APP API Key>', region: Customerio::Regions::US }

Usage

Use it as you would usually:

class MyMailer < ApplicationMailer
  def whatever # whatever.{html,text}.erb will be used as body
    mail to: 'someone@somewhere.com', subject: 'Hello from Rails!'
  end
end

Or rely on Customer.io's templated messages with:

class MyMailer < ApplicationMailer
  def whatever_with_template
    mail to: 'someone@somewhere.com', subject: 'Hello from Rails!', transactional_message_id: 3, message_data: { myvar: 'a value', another_one: 42x }
  end
end

License

The Customer.io Rails gem is licensed under the MIT license. Refer to the LICENSE file for more information.