0.0
No commit activity in last 3 years
No release in over 3 years
Action Mailer adapter for using Circuit in Rails apps.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 12
~> 6

Runtime

 Project Readme

Gem Version

circuit_rails

circuit_rails is an Action Mailer adapter for sending messages to Circuit from Rails apps. It uses the Circuit REST API thru the circuit_client gem.

Installing

In your Gemfile

gem 'circuit_rails'

Usage

In your environment configuration (development.rb, production.rb, ...) configure circuit settings:

config.action_mailer.circuit_settings = {
  client_id: '<your client_id>',
  client_secret: '<your client_secret>',
}

If you want to set it as default delivery_method:

config.action_mailer.delivery_method = :circuit

Or create a base class for circuit mailers:

# apps/mailers/circuit_mailer.rb
class CircuitMailer < ApplicationMailer
  self.delivery_method = :circuit
  # default conversation: '<your default conversation>'
end

Then use this class in your mailers:

# apps/mailers/hello_world_mailer.rb
class HelloWorldMailer < CircuitMailer
  def hello_world
    mail(subject: 'Hello World!', conversation: '<convId>')
  end
end