Project

trycourier

0.02
A long-lived project that still receives updates
Ruby library to access the Courier API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

 Project Readme

Courier Ruby SDK

The Courier Ruby SDK provides typed access to the Courier REST API from Ruby applications. Use it to send notifications, manage user profiles, check message status, issue JWT tokens for client-side SDKs, and more.

Installation

Add the gem to your Gemfile:

gem "trycourier", "~> 4.26.2"

Then run bundle install. Requires Ruby 3.2+.

Quick Start

require "bundler/setup"
require "courier"

courier = Courier::Client.new(
  api_key: ENV["COURIER_API_KEY"] # the default, can be omitted
)

response = courier.send_.message(
  message: {to: {user_id: "your_user_id"}, template: "your_template_id", data: {foo: "bar"}}
)

puts(response.requestId)

The client reads COURIER_API_KEY from your environment automatically.

Note the trailing underscore on send_send is reserved in Ruby.

Documentation

Full documentation: courier.com/docs/sdk-libraries/ruby