Class: Moonbase::Resources::ProgramMessages

Inherits:
Object
  • Object
show all
Defined in:
lib/moonbase/resources/program_messages.rb

Overview

Manage your marketing campaigns and forms

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ ProgramMessages

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ProgramMessages.

Parameters:



36
37
38
# File 'lib/moonbase/resources/program_messages.rb', line 36

def initialize(client:)
  @client = client
end

Instance Method Details

#send_(person:, program_template_id:, custom_variables: nil, request_options: {}) ⇒ Moonbase::Models::ProgramMessage

Sends a message using a program template.

Parameters:

  • person (Moonbase::Models::ProgramMessageSendParams::Person)

    The person to send the message to.

  • program_template_id (String)

    The ID of the ‘ProgramTemplate` to use for sending the message.

  • custom_variables (Hash{Symbol=>Object})

    Any custom Liquid variables to be interpolated into the message template.

  • request_options (Moonbase::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



22
23
24
25
26
27
28
29
30
31
# File 'lib/moonbase/resources/program_messages.rb', line 22

def send_(params)
  parsed, options = Moonbase::ProgramMessageSendParams.dump_request(params)
  @client.request(
    method: :post,
    path: "program_messages",
    body: parsed,
    model: Moonbase::ProgramMessage,
    options: options
  )
end