Update a Triggered Send Definition verified

Learn how to update a Triggered Send Definition in Salesforce Marketing Cloud (SFMC) with SSJS (server-side JavaScript). Code snippets include WSProxy and Core methods.

Core

var customerKey = "S0M3-GU1D-K3Y-G03SR1G4T-H3R3";

var tsd = TriggeredSend.Init(customerKey);

var config = {
    Name: "MyUpdatedTSD",
    Description: "This TSD has been updated"
}

var result = tsd.Update(config);
<script runat="server">

    Platform.Load("core", "1");

    try {

        var customerKey = "S0M3-GU1D-K3Y-G03SR1G4T-H3R3";

        var tsd = TriggeredSend.Init(customerKey);

        var config = {
            Name: "MyUpdatedTSD",
            Description: "This TSD has been updated"
        }

        var result = tsd.Update(config);

        Write(Stringify(result));

    } catch (error) {

        Write(Stringify(error));

    }

</script>
"OK"

WSProxy

var config = {
    Name: "MyUpdatedTSD",
    CustomerKey: "S0M3-GU1D-K3Y-G03SR1G4T-H3R3",
    Description: "Updated"
};

var result = api.updateItem("TriggeredSendDefinition", config);
<script runat="server">

    Platform.Load("core", "1");

    var api = new Script.Util.WSProxy();

    try {

        var config = {
            Name: "MyUpdatedTSD",
            CustomerKey: "S0M3-GU1D-K3Y-G03SR1G4T-H3R3",
            Description: "Updated"
        };

        var result = api.updateItem("TriggeredSendDefinition", config);

        Write(Stringify(result));

    } catch (error) {

        Write(Stringify(error));

    }

</script>
{
  "Status": "OK",
  "RequestID": "S0M3-GU1D-K3Y-G03SR1G4T-H3R3",
  "Results": [
    {
      "Object": {
        "CustomerKey": "S0M3-GU1D-K3Y-G03SR1G4T-H3R3",
        "Client": null,
        "Email": null,
        "List": null,
        "HeaderContentArea": null,
        "FooterContentArea": null,
        "SendClassification": null,
        "SenderProfile": null,
        "DeliveryProfile": null,
        "PrivateDomain": null,
        "PrivateIP": null,
        "ObjectID": null,
        "CreatedDate": "0001-01-01T00:00:00.000",
        "ModifiedDate": null,
        "Name": "MyUpdatedTSD",
        "Description": "Updated",
        "AutoAddSubscribers": false,
        "AutoUpdateSubscribers": false,
        "BatchInterval": 0,
        "FromName": null,
        "FromAddress": null,
        "BccEmail": null,
        "EmailSubject": null,
        "DynamicEmailSubject": null,
        "IsMultipart": false,
        "IsWrapped": false,
        "AllowedSlots": 0,
        "NewSlotTrigger": 0,
        "SendLimit": 0,
        "SendWindowOpen": "0001-01-01T00:00:00.000",
        "SendWindowClose": "0001-01-01T00:00:00.000",
        "SuppressTracking": false,
        "Keyword": null,
        "IsPlatformObject": false,
        "TriggeredSendType": "Continuous",
        "TriggeredSendStatus": "New",
        "PartnerKey": null,
        "SendWindowDelete": false,
        "RefreshContent": false,
        "ExclusionFilter": null,
        "Priority": null,
        "SendSourceCustomerKey": null,
        "ExclusionListCollection": null,
        "CCEmail": null,
        "SendSourceDataExtension": null,
        "IsAlwaysOn": false,
        "DisableOnEmailBuildError": false,
        "KeepExistingEmailSubject": false,
        "PreHeader": null,
        "ReplyToAddress": null,
        "ReplyToDisplayName": null,
        "DataSchemas": null,
        "TriggeredSendClass": "Standard",
        "TriggeredSendSubClass": "Standard",
        "TriggeredSendVersionID": 0,
        "RequestExpirationSeconds": 0,
        "OptionFlags": 0,
        "OptionFlagsUpdateMask": 0,
        "OptionVersion": 0,
        "CategoryID": 0,
        "SourceAddressType": "DefaultPrivateIPAddress",
        "DomainType": "DefaultDomain",
        "HeaderSalutationSource": "Default",
        "FooterSalutationSource": "Default",
        "IsSendLogging": false,
        "InteractionObjectID": null,
        "PartnerProperties": null,
        "ID": 0,
        "Owner": null,
        "CorrelationID": null,
        "ObjectState": null
      },
      "UpdateResults": null,
      "ParentPropertyName": null,
      "StatusCode": "OK",
      "StatusMessage": "TriggeredSendDefinition updated",
      "OrdinalID": 0,
      "ErrorCode": 0,
      "RequestID": null,
      "ConversationID": null,
      "OverallStatusCode": null,
      "RequestType": "Synchronous",
      "ResultType": null,
      "ResultDetailXML": null
    }
  ]
}

Reference

Ressources and references related to the current methods.

Official documentation
SOAP object

Last Updated: