Class: Iterable::Workflows

Inherits:
ApiResource show all
Defined in:
lib/iterable/workflows.rb

Overview

Interact with /workflows API endpoints

Examples:

Creating workflows endpoint object

# With default config
templates = Iterable::Workflows.new
templates.get

# With custom config
conf = Iterable::Config.new(token: 'new-token')
templates = Iterable::Workflows.new(config)

Instance Attribute Summary

Attributes inherited from ApiResource

#conf

Instance Method Summary collapse

Methods inherited from ApiResource

#default_config, default_config, #initialize

Constructor Details

This class inherits a constructor from Iterable::ApiResource

Instance Method Details

#trigger(workflow_id, attrs = {}) ⇒ Iterable::Response

Note:

An email or listId is required to trigger a workflow

Trigger a workflow for an email or a list.

Parameters:

  • workflow_id (Integer)

    workflow_id to trigger

  • attrs (Hash) (defaults to: {})

    Additional data fields

Returns:



25
26
27
28
# File 'lib/iterable/workflows.rb', line 25

def trigger(workflow_id, attrs = {})
  attrs['workflowId'] = workflow_id
  Iterable.request(conf, '/workflows/triggerWorkflow').post(attrs)
end