SendClassification
Core library SendClassification — ties a sender profile and delivery profile for compliant sends.
SendClassification groups a sender profile and delivery profile for use when creating sends and send definitions. Updates must include both SenderProfileKey and DeliveryProfileKey in the properties object.
Requires Platform.Load("core", "1.1.5") before use.
Methods
| Method | Returns | Description |
|---|---|---|
SendClassification.Init(key) |
SendClassificationInstance | Bind by external key |
SendClassification.Add(properties) |
string | Create a send classification |
SendClassification.Retrieve(filter) |
object[] | Query classifications |
<SendClassificationInstance>.Update(properties) |
string | Update (requires sender + delivery keys) |
<SendClassificationInstance>.Remove() |
string | Delete the classification |
SendClassification.Init
Initializes a SendClassification instance for the given external key.
Syntax
SendClassification.Init(key)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
key |
string | Yes | External key |
Return value
SendClassificationInstance
Examples
Platform.Load("core", "1");
var sc = SendClassification.Init("mySendClassification");
SendClassification.Add
Creates a new send classification with the specified properties.
Syntax
SendClassification.Add(properties)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
properties |
object | Yes | CustomerKey, Name, Description, SenderProfileKey, DeliveryProfileKey |
Return value
"OK" on success.
Examples
Platform.Load("core", "1.1.5");
var newSC = {
CustomerKey: "mySCKey",
Name: "SSJS Test SC",
Description: "Test SSJS description",
SenderProfileKey: "mySPKey",
DeliveryProfileKey: "myDPKey"
};
SendClassification.Add(newSC);
SendClassification.Retrieve
Queries send classifications matching the given filter criteria.
Syntax
SendClassification.Retrieve(filter)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
filter |
object | Yes | WSProxy-style filter |
Return value
object[]
Examples
Platform.Load("core", "1.1.5");
var results = SendClassification.Retrieve({
Property: "CustomerKey",
SimpleOperator: "equals",
Value: "mySendClassification"
});
<SendClassificationInstance>.Update
Updates the initialized send classification. You must include both SenderProfileKey and DeliveryProfileKey for the update to succeed.
Syntax
<SendClassificationInstance>.Update(properties)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
properties |
object | Yes | Includes SenderProfileKey and DeliveryProfileKey |
Return value
"OK" on success.
Examples
Platform.Load("core", "1.1.5");
var sc = SendClassification.Init("mySendClassification");
var updatedSC = {
Name: "Updated Send Classification",
SenderProfileKey: "mySPKey",
DeliveryProfileKey: "myDPKey"
};
var status = sc.Update(updatedSC);
<SendClassificationInstance>.Remove
Removes the initialized send classification.
Syntax
<SendClassificationInstance>.Remove()
Return value
"OK" on success.
Examples
Platform.Load("core", "1.1.5");
var sc = SendClassification.Init("mySendClassification");
var status = sc.Remove();