Using the documentation in the SF Help docs I am trying to create send an email to a specific person using the following code:
<script type="text/javascript" runat="server">
try {
Platform.Load("Core", "1.1.1");
var time = Now();
var systemTime = Platform.Function.SystemDateToLocalDate(time);
var esdParams = {
"CustomerKey": "test_send_definition",
"Name": "test_send_definition",
"EmailSubject": "This is the default subject"
};
// local values
var scKey = '100';
var emailKey = 'my_test_email';
var deKey = 'send_dataextension';
var pubListKey = 'Test_Publication_List';
Send.Definition.AddWithDE(esdParams, scKey, emailKey, deKey, pubListKey);
// send the email to the send definition
var esd = Send.Definition.Init('ssjs_sent_test_1');
var status = esd.Send();
} catch (ex) {
Write("failure message: " + ex );
}
However running this code returns the following error:
failure message: Error adding EmailSendDefinition.
The 100
key is the Sender Classification, and my user initiated send references the same Send Classification, Email Template and Targeted Data Extension.
Any ideas on what could be the issue or how to debug would be appreciated.
100
is just for this example, I use a different ID in my real script. – Deployment Failure Nov 12 '18 at 14:55