pgp.createMessageData(options)

Note:

The content in this help topic pertains to SuiteScript 2.1.

Method Description

Creates a new pgp.MessageData object. A message data object stores message content with metadata.

Returns

pgp.MessageData

Supported Script Types

Server scripts

Governance

None

Module

N/pgp Module

Sibling Module Members

N/pgp Module Members

Since

2022.2

Parameters

Parameter

Type

Required / Optional

Description

options.content

string

required

Content of the message.

options.filename

string

optional

File name if the message represents a file, empty string otherwise.

options.date

Date object

optional

Date of the message or modification date of the file. Default value = new Date().

options.format

pgp.Format

optional

Literal data packet type. Default value = Format.UTF8, if content is a string. Format.BINARY otherwise.

Syntax

Important:

The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/pgp Module Script Samples.

            // Add additional code
...

const msgData = pgp.createMessageData({
   content: 'Hello'
})

...
// Add additional code 

          

Related Topics

General Notices