1

I want to create a triggered send definition using SFMC SSJS. This should be possible using either the TriggeredSend Platform object's Add method or via WSProxy. However, I can not get either to work.

NOTE: I am NOT trying to SEND a triggered send using a triggered send definition that has already been created. Rather, I want to CREATE the triggered send definition itself.

Using Platform Object (as described in SFMC Documentation)

var newTSD = {
   "Name" : "zzTSDDMPTemp",
   "CustomerKey" : "zzTSDDMPTemp",
   "FromName" : "Test From Name",
   "FromAddress" : "[email protected]",
   "EmailID" : 1449164,
   "SendClassificationID" : "Default Transactional"
};
var tsd = TriggeredSend.Add(newTSD);

Response is: "Error adding TSD."

Using WSProxy (following SOAP Example described here)

var newTSD2 = {
    Name: "zzTSDDMPTemp",
    CustomerKey:"zzTSDDMPTemp",
    SendClassification:{CustomerKey:"Default Transactional"},
    Email:{ID:1449164},
    SendSourceDataExtension:{CustomerKey:"TRV_ENT_ForwardDemo-TSD_TEST_DE"}
};

var prox = new Script.Util.WSProxy();
var resp = prox.createItem("TriggeredSendDefinition", newTSD2);

Response is: Exception occurred during [CreateTriggeredSendDefinition] ErrorID: 1488072974

1 Answer 1

0

Don't trust the official documentation, trust my documentation instead:

https://www.ssjsdocs.xyz/email-studio/triggeredsends/create.html

In a nutshell, you need to pass a valid SenderProfile and your Data Extension needs to be created with the Triggered Send Data Extension Template.

1
  • Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
    – identigral
    Dec 21, 2022 at 2:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .