Class 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.
Syntax
Constructors
SpmMessage()
Initializes a new instance of the SpmMessage class.
Declaration
SpmMessage
Methods
save()
Saves an SpmMessage object. If this is a new SpmMessage object (no ID set), a new one will be created.
Declaration
Integer save()
Returns
| Type | Description |
|---|---|
| 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).
Declaration
Void setBody(String body)
Parameters
| Type | Name | Description |
|---|---|---|
| String | body | The plain text version of the body. |
Returns
| Type | Description |
|---|---|
| Void |
setBodyHtml(String)
Sets the HTML body version of the SpmMessage object (will correspond to the text/html version in the outgoing email).
Declaration
Void setBodyHtml(String htmlBody)
Parameters
| Type | Name | Description |
|---|---|---|
| String | htmlBody | The HTML version of the body. |
Returns
| Type | Description |
|---|---|
| Void |
setDescription(String)
Sets the descriptive text of the SpmMessage.
Declaration
Void setDescription(String description)
Parameters
| Type | Name | Description |
|---|---|---|
| String | description | A text which describes this message. |
Returns
| Type | Description |
|---|---|
| Void |
Remarks
It is not used in the outgoing email, but will be visible when listed in Service.
setFolderId(Integer)
Sets the folder which this SpmMessage will be stored in.
Declaration
Void setFolderId(Integer folderId)
Parameters
| Type | Name | Description |
|---|---|---|
| Integer | folderId | The ID of the folder this message will be stored in. A value of -1 indicates that it should be stored in the root folder. |
Returns
| Type | Description |
|---|---|
| Void |
Remarks
If you specify a folder ID that does not exist, the message will not be visible through Service.
setHeader(String)
If you need to include additional email headers, they should be added here. You have to format these yourself.
Declaration
Void setHeader(String header)
Parameters
| Type | Name | Description |
|---|---|---|
| String | header | The the information. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
Header1: Value1
Header2: Value2
setSubject(String)
Sets the subject of the SpmMessage object. Corresponds to the subject in the outgoing email.
Declaration
Void setSubject(String subject)
Parameters
| Type | Name | Description |
|---|---|---|
| String | subject | The subject of the SpmMessage object. |
Returns
| Type | Description |
|---|---|
| Void |