Sha256: 88abd82adb021dc28366568d8719ff0a036213d37ff47c27b3e5ab3a4bc50219

Contents?: true

Size: 637 Bytes

Versions: 4

Compression:

Stored size: 637 Bytes

Contents

module Mautic
  class Stage < Model

    # @see https://developer.mautic.org/#add-contact-to-a-stage
    # @param [Integer] id of Mautic::Contact
    def add_contact!(id)
      json = @connection.request(:post, "api/stages/#{self.id}/contact/#{id}/add")
      json["success"]
    rescue RequestError => _e
      false
    end

    # @see https://developer.mautic.org/#remove-contact-from-a-stage
    # @param [Integer] id of Mautic::Contact
    def remove_contact!(id)
      json = @connection.request(:post, "api/stages/#{self.id}/contact/#{id}/remove")
      json["success"]
    rescue RequestError => _e
      false
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mautic-3.1.0 app/models/mautic/stage.rb
mautic-3.0.0 app/models/mautic/stage.rb
mautic-2.6.1 app/models/mautic/stage.rb
mautic-2.6.0 app/models/mautic/stage.rb