> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# NSPreviewMailing

## Constructors

### NSPreviewMailing()

```crmscript theme={null}
NSPreviewMailing
```

## Methods

## GetContactId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Owning contact Id.

**Example:**

```crmscript theme={null}
NSPreviewMailing thing;
Integer contactId = thing.GetContactId();
```

## GetContactName()

```crmscript theme={null}
String GetContactName()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Contact name.

**Example:**

```crmscript theme={null}
NSPreviewMailing thing;
String contactName = thing.GetContactName();
```

## GetDocumentMessageId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - If a document was used as the message this is the document ID.

**Example:**

```crmscript theme={null}
NSPreviewMailing thing;
Integer documentMessageId = thing.GetDocumentMessageId();
```

## GetFromAddress()

```crmscript theme={null}
String GetFromAddress()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Email address to put in the From header of the messages.

**Example:**

```crmscript theme={null}
NSPreviewMailing thing;
String fromAddress = thing.GetFromAddress();
```

## GetLinkClicks()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The number of links clicked in the mailing.

**Example:**

```crmscript theme={null}
NSPreviewMailing thing;
Integer linkClicks = thing.GetLinkClicks();
```

## GetMessageId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Primary key.

**Example:**

```crmscript theme={null}
NSPreviewMailing thing;
Integer messageId = thing.GetMessageId();
```

## GetMessageSubject()

```crmscript theme={null}
String GetMessageSubject()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The mail subject field of the message.

**Example:**

```crmscript theme={null}
NSPreviewMailing thing;
String messageSubject = thing.GetMessageSubject();
```

## GetOpened()

```crmscript theme={null}
DateTime GetOpened()
```

**Returns:** [CRMScript.Global.DateTime](CRMScript.Global.DateTime) - Date/time the customer read the mailing.

**Example:**

```crmscript theme={null}
NSPreviewMailing thing;
DateTime opened = thing.GetOpened();
```

## GetPersonFullName()

```crmscript theme={null}
String GetPersonFullName()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Gets the persons full name (internal name used in clients for employees).

**Example:**

```crmscript theme={null}
NSPreviewMailing thing;
String personFullName = thing.GetPersonFullName();
```

## GetPersonId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Primary key.

**Example:**

```crmscript theme={null}
NSPreviewMailing thing;
Integer personId = thing.GetPersonId();
```

## GetSendingTime()

```crmscript theme={null}
DateTime GetSendingTime()
```

**Returns:** [CRMScript.Global.DateTime](CRMScript.Global.DateTime) - Estimated or actual sent time (depends on status).

**Example:**

```crmscript theme={null}
NSPreviewMailing thing;
DateTime sendingTime = thing.GetSendingTime();
```

## GetShipmentDescription()

```crmscript theme={null}
String GetShipmentDescription()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Describes the shipment.

**Example:**

```crmscript theme={null}
NSPreviewMailing thing;
String shipmentDescription = thing.GetShipmentDescription();
```

## GetShipmentId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Primary key.

**Example:**

```crmscript theme={null}
NSPreviewMailing thing;
Integer shipmentId = thing.GetShipmentId();
```

## GetShipmentType()

```crmscript theme={null}
String GetShipmentType()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The list item.

**Example:**

```crmscript theme={null}
NSPreviewMailing thing;
String shipmentType = thing.GetShipmentType();
```

## GetStatus()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Status for sending to this particular recipient. See \<xref href="CRMScript.NetServer.ShipmentAddrStatus" data-throw-if-not-resolved="false">\</xref>.

**Example:**

```crmscript theme={null}
NSPreviewMailing thing;
Integer status = thing.GetStatus();
```

## SetContactId(Integer)

```crmscript theme={null}
Void SetContactId(Integer contactId)
```

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

**Example:**

```crmscript theme={null}
NSPreviewMailing thing;
Integer contactId;
thing.SetContactId(contactId);
```

## SetContactName(String)

```crmscript theme={null}
Void SetContactName(String contactName)
```

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

**Example:**

```crmscript theme={null}
NSPreviewMailing thing;
String contactName;
thing.SetContactName(contactName);
```

## SetDocumentMessageId(Integer)

```crmscript theme={null}
Void SetDocumentMessageId(Integer documentMessageId)
```

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

**Example:**

```crmscript theme={null}
NSPreviewMailing thing;
Integer documentMessageId;
thing.SetDocumentMessageId(documentMessageId);
```

## SetFromAddress(String)

```crmscript theme={null}
Void SetFromAddress(String fromAddress)
```

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

**Example:**

```crmscript theme={null}
NSPreviewMailing thing;
String fromAddress;
thing.SetFromAddress(fromAddress);
```

## SetLinkClicks(Integer)

```crmscript theme={null}
Void SetLinkClicks(Integer linkClicks)
```

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

**Example:**

```crmscript theme={null}
NSPreviewMailing thing;
Integer linkClicks;
thing.SetLinkClicks(linkClicks);
```

## SetMessageId(Integer)

```crmscript theme={null}
Void SetMessageId(Integer messageId)
```

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

**Example:**

```crmscript theme={null}
NSPreviewMailing thing;
Integer messageId;
thing.SetMessageId(messageId);
```

## SetMessageSubject(String)

```crmscript theme={null}
Void SetMessageSubject(String messageSubject)
```

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

**Example:**

```crmscript theme={null}
NSPreviewMailing thing;
String messageSubject;
thing.SetMessageSubject(messageSubject);
```

## SetOpened(DateTime)

```crmscript theme={null}
Void SetOpened(DateTime opened)
```

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

**Example:**

```crmscript theme={null}
NSPreviewMailing thing;
DateTime opened;
thing.SetOpened(opened);
```

## SetPersonFullName(String)

```crmscript theme={null}
Void SetPersonFullName(String personFullName)
```

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

**Example:**

```crmscript theme={null}
NSPreviewMailing thing;
String personFullName;
thing.SetPersonFullName(personFullName);
```

## SetPersonId(Integer)

```crmscript theme={null}
Void SetPersonId(Integer personId)
```

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

**Example:**

```crmscript theme={null}
NSPreviewMailing thing;
Integer personId;
thing.SetPersonId(personId);
```

## SetSendingTime(DateTime)

```crmscript theme={null}
Void SetSendingTime(DateTime )
```

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

**Example:**

```crmscript theme={null}
NSPreviewMailing thing;
DateTime sendingTime;
thing.SetSendingTime(sendingTime);
```

## SetShipmentDescription(String)

```crmscript theme={null}
Void SetShipmentDescription(String shipmentDescription)
```

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

**Example:**

```crmscript theme={null}
NSPreviewMailing thing;
String shipmentDescription;
thing.SetShipmentDescription(shipmentDescription);
```

## SetShipmentId(Integer)

```crmscript theme={null}
Void SetShipmentId(Integer shipmentId)
```

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

**Example:**

```crmscript theme={null}
NSPreviewMailing thing;
Integer shipmentId;
thing.SetShipmentId(shipmentId);
```

## SetShipmentType(String)

```crmscript theme={null}
Void SetShipmentType(String shipmentType)
```

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

**Example:**

```crmscript theme={null}
NSPreviewMailing thing;
String shipmentType;
thing.SetShipmentType(shipmentType);
```

## SetStatus(Integer)

```crmscript theme={null}
Void SetStatus(Integer status)
```

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

**Example:**

```crmscript theme={null}
NSPreviewMailing thing;
Integer status;
thing.SetStatus(status);
```


## Related topics

- [NSMarketingAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSMarketingAgent.md)
- [NSPreviewMailingHeader](/en/automation/crmscript/reference/CRMScript.NetServer.NSPreviewMailingHeader.md)
- [Get Preview Mailing](/en/api/reference/restful/agent/marketing_agent/get-preview-mailing.md)
- [Get Preview Mailing Header](/en/api/reference/restful/agent/marketing_agent/get-preview-mailing-header.md)
- [Tutorial - document mailing](/en/marketing/mailing/learn/create/tutorial-document-mailing.md)
- [Tutorial - email mailing](/en/marketing/mailing/learn/create/tutorial-email-mailing.md)
