Class: Sipity::NotifiableContext

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/sipity/notifiable_context.rb

Overview

A bridge for defining the “contexts” in which emails are sent.

When an object enters a new state, we want to be able to define what are the emails that should be sent.

In Sipity this could be modeled by defining a NotifiableContext for a WorkflowState and Email.

Examples:

workflow_state = Sipity::WorkflowState.new
notification = Sipity::Notification.new

Sipity::NotifiableContext.new(
  scope_for_notification: workflow_state,
  reason_for_notification: 'on_enter',
  notification: notification
)

Constant Summary collapse

REASON_ACTION_IS_TAKEN =
'action_is_taken'.freeze