Options
All
  • Public
  • Public/Protected
  • All
Menu

Message builder. Allows the message to be built and sent via method chaining.

Example:

await testConversation.prepareMessage()
  .setBody('Hello!')
  .setAttributes({foo: 'bar'})
  .addMedia(media1)
  .addMedia(media2)
  .build()
  .send();

Hierarchy

  • MessageBuilder

Index

Methods

addMedia

build

  • Builds the message, making it ready to be sent.

    Returns UnsentMessage

buildAndSend

setAttributes

setBody

  • Sets the message body.

    Parameters

    • text: string

      Contents of the body.

    Returns MessageBuilder

setEmailBody

  • Set the email body with a given content type.

    Parameters

    • contentType: string

      Format of the body to set (text/plain or text/html).

    • body: FormData | SendMediaOptions

      Body payload in the selected format.

    Returns MessageBuilder

setEmailHistory

  • Set the email history with a given content type.

    Parameters

    • contentType: string

      Format of the history to set (text/plain or text/html).

    • history: FormData | SendMediaOptions

      History payload in the selected format.

    Returns MessageBuilder

setSubject

  • Sets the message subject.

    Parameters

    • subject: string

      Contents of the subject.

    Returns MessageBuilder