Method: Bento::Subscribers.run_command

Defined in:
lib/bento/resources/subscribers.rb

.run_command(command:, email:, query: nil) ⇒ Object

Run a command to change a subscriber’s data Usage: Bento::Subscribers.run_command(command: ‘add_tag’, email: ‘[email protected]’, query: ‘new_tag’)



50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/bento/resources/subscribers.rb', line 50

def run_command(command:, email:, query: nil)
  payload = {
    command: [{
      command: command,
      email: email,
      query: query
    }]
  }.to_json
  
  response = client.post("api/v1/fetch/commands?#{URI.encode_www_form(default_params)}", payload)
  Bento::Response.new(response)
end