Class: Telnyx::Resources::EmailInboxes::Messages::Actions

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/email_inboxes/messages/actions.rb,
sig/telnyx/resources/email_inboxes/messages/actions.rbs

Overview

Create and manage agent inboxes, retrieve inbound messages and threads, and reply to or forward messages.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Actions

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

Parameters:



142
143
144
# File 'lib/telnyx/resources/email_inboxes/messages/actions.rb', line 142

def initialize(client:)
  @client = client
end

Instance Method Details

#forward(message_id, inbox_id:, to:, bcc: nil, cc: nil, html: nil, text: nil, request_options: {}) ⇒ Telnyx::Models::EmailInboxes::EmailMessageResponse

Some parameter documentations has been truncated, see Models::EmailInboxes::Messages::ActionForwardParams for more details.

Sends from the inbox address through the standard email send pipeline to caller-supplied To, Cc, and Bcc recipients. to must contain at least one recipient. Optional text and html are prepended to a forwarded-message block containing the original metadata and available body content. The subject is prefixed with Fwd: unless it already has that prefix.

Threading headers are derived from the original message: In-Reply-To is set to its RFC Message-ID, and References contains the original References values plus that Message-ID, de-duplicated and limited to the most recent 20 values.

Parameters:

Returns:

See Also:



44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/telnyx/resources/email_inboxes/messages/actions.rb', line 44

def forward(message_id, params)
  parsed, options = Telnyx::EmailInboxes::Messages::ActionForwardParams.dump_request(params)
  inbox_id =
    parsed.delete(:inbox_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :post,
    path: ["email_inboxes/%1$s/messages/%2$s/actions/forward", inbox_id, message_id],
    body: parsed,
    model: Telnyx::EmailInboxes::EmailMessageResponse,
    options: options
  )
end

#reply(message_id, inbox_id:, html: nil, text: nil, request_options: {}) ⇒ Telnyx::Models::EmailInboxes::EmailMessageResponse

Sends from the inbox address through the standard email send pipeline. The recipient is the original Reply-To, falling back to From; original Cc recipients are not included. The subject is prefixed with Re: unless it already has that prefix.

Threading headers are derived from the original message: In-Reply-To is set to its RFC Message-ID, and References contains the original References values plus that Message-ID, de-duplicated and limited to the most recent 20 values.

Parameters:

  • message_id (String)

    Path param: Inbound email message UUID.

  • inbox_id (String)

    Path param: Email inbox UUID.

  • html (String)

    Body param: HTML reply body.

  • text (String)

    Body param: Plain-text reply body.

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

Returns:

See Also:



83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/telnyx/resources/email_inboxes/messages/actions.rb', line 83

def reply(message_id, params)
  parsed, options = Telnyx::EmailInboxes::Messages::ActionReplyParams.dump_request(params)
  inbox_id =
    parsed.delete(:inbox_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :post,
    path: ["email_inboxes/%1$s/messages/%2$s/actions/reply", inbox_id, message_id],
    body: parsed,
    model: Telnyx::EmailInboxes::EmailMessageResponse,
    options: options
  )
end

#reply_all(message_id, inbox_id:, html: nil, text: nil, request_options: {}) ⇒ Telnyx::Models::EmailInboxes::EmailMessageResponse

Sends from the inbox address through the standard email send pipeline. The To list starts with the original Reply-To (or From) and includes original To recipients; the Cc list includes original Cc recipients. The inbox address is excluded, and recipients are de-duplicated case-insensitively across To and Cc. Bcc is always empty. The subject is prefixed with Re: unless it already has that prefix.

Threading headers are derived from the original message: In-Reply-To is set to its RFC Message-ID, and References contains the original References values plus that Message-ID, de-duplicated and limited to the most recent 20 values.

Parameters:

  • message_id (String)

    Path param: Inbound email message UUID.

  • inbox_id (String)

    Path param: Email inbox UUID.

  • html (String)

    Body param: HTML reply body.

  • text (String)

    Body param: Plain-text reply body.

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

Returns:

See Also:



124
125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/telnyx/resources/email_inboxes/messages/actions.rb', line 124

def reply_all(message_id, params)
  parsed, options = Telnyx::EmailInboxes::Messages::ActionReplyAllParams.dump_request(params)
  inbox_id =
    parsed.delete(:inbox_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :post,
    path: ["email_inboxes/%1$s/messages/%2$s/actions/reply_all", inbox_id, message_id],
    body: parsed,
    model: Telnyx::EmailInboxes::EmailMessageResponse,
    options: options
  )
end