Class: PreludeSDK::Resources::Transactional

Inherits:
Object
  • Object
show all
Defined in:
lib/prelude_sdk/resources/transactional.rb

Overview

Send transactional messages (deprecated - use Notify API instead).

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Transactional

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 Transactional.

Parameters:



56
57
58
# File 'lib/prelude_sdk/resources/transactional.rb', line 56

def initialize(client:)
  @client = client
end

Instance Method Details

#send_(template_id:, to:, callback_url: nil, correlation_id: nil, document: nil, expires_at: nil, from: nil, locale: nil, preferred_channel: nil, variables: nil, request_options: {}) ⇒ PreludeSDK::Models::TransactionalSendResponse

Deprecated.

Some parameter documentations has been truncated, see Models::TransactionalSendParams for more details.

Legacy route maintained for backward compatibility. Migrate to ‘/v2/notify` instead.

Parameters:

  • template_id (String)

    The template identifier.

  • to (String)

    The recipient’s phone number.

  • callback_url (String)

    The callback URL.

  • correlation_id (String)

    A user-defined identifier to correlate this transactional message with. It is re

  • document (PreludeSDK::Models::TransactionalSendParams::Document)

    A media attachment to include in the message header. Supported on

  • expires_at (String)

    The message expiration date.

  • from (String)

    The Sender ID.

  • locale (String)

    A BCP-47 formatted locale string with the language the text message will be sent

  • preferred_channel (Symbol, PreludeSDK::Models::TransactionalSendParams::PreferredChannel)

    The preferred delivery channel for the message. When specified, the system will

  • variables (Hash{Symbol=>String})

    The variables to be replaced in the template.

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

Returns:

See Also:



42
43
44
45
46
47
48
49
50
51
# File 'lib/prelude_sdk/resources/transactional.rb', line 42

def send_(params)
  parsed, options = PreludeSDK::TransactionalSendParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v2/transactional",
    body: parsed,
    model: PreludeSDK::Models::TransactionalSendResponse,
    options: options
  )
end