> ## Documentation Index
> Fetch the complete documentation index at: https://superofficeas-bugfix-ty-screen-designer-paradox.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# SpmMessage

> Represent a message in the eMarketeer module. You can create or modify such objects, which later is used by the SpmShipment class to send such messages.

Represent a message in the eMarketeer module. You can create or modify such objects, which later is used by the SpmShipment class to send such messages.

## Constructors

### SpmMessage()

```crmscript theme={null}
SpmMessage
```

Initializes a new instance of the SpmMessage class.

## Methods

## save()

Saves an SpmMessage object. If this is a new SpmMessage object (no ID set), a new one will be created.

```crmscript theme={null}
Integer save()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The ID of the SpmMessage object.

## setBody(String)

Sets the body version of the SpmMessage object (will correspond to the text/plain version in the outgoing email).

```crmscript theme={null}
Void setBody(String body)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

## setBodyHtml(String)

Sets the HTML body version of the SpmMessage object (will correspond to the text/html version in the outgoing email).

```crmscript theme={null}
Void setBodyHtml(String htmlBody)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

## setDescription(String)

Sets the descriptive text of the SpmMessage.

```crmscript theme={null}
Void setDescription(String description)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

<Note>
  It is not used in the outgoing email, but will be visible when listed in Service.
</Note>

## setFolderId(Integer)

Sets the folder which this SpmMessage will be stored in.

```crmscript theme={null}
Void setFolderId(Integer folderId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

<Note>
  If you specify a folder ID that does not exist, the message will not be visible through Service.
</Note>

## setHeader(String)

If you need to include additional email headers, they should be added here. You have to format these yourself.

```crmscript theme={null}
Void setHeader(String header)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
Header1: Value1
Header2: Value2
```

## setSubject(String)

Sets the subject of the SpmMessage object. Corresponds to the subject in the outgoing email.

```crmscript theme={null}
Void setSubject(String subject)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)
