> ## 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.

# NSMailMergeSettings

> Settings specifying what selection to perform the mailmerge on, what merge document to use etc.

Settings specifying what selection to perform the mailmerge on, what merge document to use etc.

## Constructors

### NSMailMergeSettings()

```crmscript theme={null}
NSMailMergeSettings
```

Initializes a new instance of the NSMailMergeSettings class.

## Methods

## GetAddCompanyInterest()

Adds this company interest to each company recipient.

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

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

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
Integer addCompanyInterest = thing.GetAddCompanyInterest();
```

## GetAddPersonInterest()

Adds this person interest to each person recipient.

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

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

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
Integer addPersonInterest = thing.GetAddPersonInterest();
```

## GetAlwaysUseCustomAttention()

```crmscript theme={null}
Bool GetAlwaysUseCustomAttention()
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - Should custom attention always be used? If false, only use custom attention where there is no default.

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
Bool alwaysUseCustomAttention = thing.GetAlwaysUseCustomAttention();
```

## GetCustomAttention()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Custom value for attention.

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
String customAttention = thing.GetCustomAttention();
```

## GetCustomMailBody()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - If specified, use this value as default mail body.

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
String customMailBody = thing.GetCustomMailBody();
```

## GetCustomMailSubject()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - If specified, use this value as default mail subject.

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
String customMailSubject = thing.GetCustomMailSubject();
```

## GetDocumentId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Identity of document to be used as merge draft.

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
Integer documentId = thing.GetDocumentId();
```

## GetExtraInfo()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Used to store additional information for the delivery systems.

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
String extraInfo = thing.GetExtraInfo();
```

## GetIncludeNoMailingsRecipient()

```crmscript theme={null}
Bool GetIncludeNoMailingsRecipient()
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - Include recipients that are marked with NoMailings.

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
Bool includeNoMailingsRecipient = thing.GetIncludeNoMailingsRecipient();
```

## GetIncludeRetiredRecipients()

```crmscript theme={null}
Bool GetIncludeRetiredRecipients()
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - Include recipients that are marked as retired.

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
Bool includeRetiredRecipients = thing.GetIncludeRetiredRecipients();
```

## GetIncludeStoppedRecipients()

Include recipients that are marked with stop

```crmscript theme={null}
Bool GetIncludeStoppedRecipients()
```

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

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
Bool includeStoppedRecipients = thing.GetIncludeStoppedRecipients();
```

## GetIsTemporarySelection()

```crmscript theme={null}
Bool GetIsTemporarySelection()
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - If true, the selection is a temporary selection that can be deleted later.

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
Bool isTemporarySelection = thing.GetIsTemporarySelection();
```

## GetMailMergeDeliveryType()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - How the merged document is delivered to the recipients. See \<xref href="CRMScript.NetServer.EMailMergeTargetType" data-throw-if-not-resolved="false">\</xref>

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
Integer mailMergeDeliveryType = thing.GetMailMergeDeliveryType();
```

## GetProjectId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Identity of project to use as source for recipients.

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
Integer projectId = thing.GetProjectId();
```

## GetRemoveCompanyInterest()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Remove this company interest on each company recipient.

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
Integer removeCompanyInterest = thing.GetRemoveCompanyInterest();
```

## GetRemovePersonInterest()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Remove this person interest on each person recipient.

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
Integer removePersonInterest = thing.GetRemovePersonInterest();
```

## GetSaveDocument()

```crmscript theme={null}
Bool GetSaveDocument()
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - Should we save a reference to the merge document on each recipient.

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
Bool saveDocument = thing.GetSaveDocument();
```

## GetSelectionId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Identity of selection to use as source for recipients.

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
Integer selectionId = thing.GetSelectionId();
```

## GetSynchronous()

```crmscript theme={null}
Bool GetSynchronous()
```

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

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
Bool synchronous = thing.GetSynchronous();
```

## GetTaskEntity()

```crmscript theme={null}
NSMailMergeTask GetTaskEntity()
```

**Returns:** [CRMScript.NetServer.NSMailMergeTask](CRMScript.NetServer.NSMailMergeTask) - If specified, register a task on recipients using properties from this object.

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
NSMailMergeTask taskEntity = thing.GetTaskEntity();
```

## GetTestOnly()

```crmscript theme={null}
Bool GetTestOnly()
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - If true, do the merge task, but use current user as target, instead of selection members.

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
Bool testOnly = thing.GetTestOnly();
```

## SetAddCompanyInterest(Integer)

Adds this company interest to each company recipient.

```crmscript theme={null}
Void SetAddCompanyInterest(Integer addCompanyInterest)
```

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

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
Integer addCompanyInterest;
thing.SetAddCompanyInterest(addCompanyInterest);
```

## SetAddPersonInterest(Integer)

Adds this person interest to each person recipient.

```crmscript theme={null}
Void SetAddPersonInterest(Integer addPersonInterest)
```

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

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
Integer addPersonInterest;
thing.SetAddPersonInterest(addPersonInterest);
```

## SetAlwaysUseCustomAttention(Bool)

```crmscript theme={null}
Void SetAlwaysUseCustomAttention(Bool alwaysUseCustomAttention)
```

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

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
Bool alwaysUseCustomAttention;
thing.SetAlwaysUseCustomAttention(alwaysUseCustomAttention);
```

## SetCustomAttention(String)

```crmscript theme={null}
Void SetCustomAttention(String customAttention)
```

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

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
String customAttention;
thing.SetCustomAttention(customAttention);
```

## SetCustomMailBody(String)

```crmscript theme={null}
Void SetCustomMailBody(String customMailBody)
```

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

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
String customMailBody;
thing.SetCustomMailBody(customMailBody);
```

## SetCustomMailSubject(String)

```crmscript theme={null}
Void SetCustomMailSubject(String customMailSubject)
```

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

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
String customMailSubject;
thing.SetCustomMailSubject(customMailSubject);
```

## SetDocumentId(Integer)

```crmscript theme={null}
Void SetDocumentId(Integer documentId)
```

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

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
Integer documentId;
thing.SetDocumentId(documentId);
```

## SetExtraInfo(String)

```crmscript theme={null}
Void SetExtraInfo(String extraInfo)
```

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

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
String extraInfo;
thing.SetExtraInfo(extraInfo);
```

## SetIncludeNoMailingsRecipient(Bool)

```crmscript theme={null}
Void SetIncludeNoMailingsRecipient(Bool includeNoMailingsRecipient)
```

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

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
Bool includeNoMailingsRecipient;
thing.SetIncludeNoMailingsRecipient(includeNoMailingsRecipient);
```

## SetIncludeRetiredRecipients(Bool)

```crmscript theme={null}
Void SetIncludeRetiredRecipients(Bool includeRetiredRecipients)
```

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

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
Bool includeRetiredRecipients;
thing.SetIncludeRetiredRecipients(includeRetiredRecipients);
```

## SetIncludeStoppedRecipients(Bool)

```crmscript theme={null}
Void SetIncludeStoppedRecipients(Bool includeStoppedRecipients)
```

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

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
Bool includeStoppedRecipients;
thing.SetIncludeStoppedRecipients(includeStoppedRecipients);
```

## SetIsTemporarySelection(Bool)

```crmscript theme={null}
Void SetIsTemporarySelection(Bool isTemporarySelection)
```

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

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
Bool isTemporarySelection;
thing.SetIsTemporarySelection(isTemporarySelection);
```

## SetMailMergeDeliveryType(Integer)

```crmscript theme={null}
Void SetMailMergeDeliveryType(Integer mailMergeDeliveryType)
```

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

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
Integer mailMergeDeliveryType;
thing.SetMailMergeDeliveryType(mailMergeDeliveryType);
```

## SetProjectId(Integer)

```crmscript theme={null}
Void SetProjectId(Integer projectId)
```

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

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
Integer projectId;
thing.SetProjectId(projectId);
```

## SetRemoveCompanyInterest(Integer)

```crmscript theme={null}
Void SetRemoveCompanyInterest(Integer removeCompanyInterest)
```

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

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
Integer removeCompanyInterest;
thing.SetRemoveCompanyInterest(removeCompanyInterest);
```

## SetRemovePersonInterest(Integer)

```crmscript theme={null}
Void SetRemovePersonInterest(Integer removePersonInterest)
```

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

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
Integer removePersonInterest;
thing.SetRemovePersonInterest(removePersonInterest);
```

## SetSaveDocument(Bool)

```crmscript theme={null}
Void SetSaveDocument(Bool saveDocument)
```

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

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
Bool saveDocument;
thing.SetSaveDocument(saveDocument);
```

## SetSelectionId(Integer)

```crmscript theme={null}
Void SetSelectionId(Integer selectionId)
```

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

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
Integer selectionId;
thing.SetSelectionId(selectionId);
```

## SetSynchronous(Bool)

```crmscript theme={null}
Void SetSynchronous(Bool synchronous)
```

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

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
Bool synchronous;
thing.SetSynchronous(synchronous);
```

## SetTaskEntity(NSMailMergeSettings)

```crmscript theme={null}
Void SetTaskEntity(NSMailMergeTask taskEntity)
```

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

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
NSMailMergeTask taskEntity;
thing.SetTaskEntity(taskEntity);
```

## SetTestOnly(Bool)

```crmscript theme={null}
Void SetTestOnly(Bool testOnly)
```

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

**Example:**

```crmscript theme={null}
NSMailMergeSettings thing;
Bool testOnly;
thing.SetTestOnly(testOnly);
```


## Related topics

- [NSSelectionAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSSelectionAgent.md)
- [NSMailMergeTask](/en/automation/crmscript/reference/CRMScript.NetServer.NSMailMergeTask.md)
- [Step settings](/en/marketing/flows/learn/step-settings.md)
- [Split and merge](/en/automation/crmscript/howto/request/split-merge.md)
- [Enum EMailMergeTargetType](/en/automation/crmscript/reference/CRMScript.NetServer.EMailMergeTargetType.md)
- [Define settings for mailings](/en/marketing/mailing/admin/define-settings-for-mailings.md)
