Awaken Scripting User Guide |
|||||
|
|||||
Name
|
Required / Optional
|
Explanation
|
connectorType
|
Required
|
This is the type of connector to be used, and must be set to "connector-email-outbound" for this function.
|
connectorName
|
Required
|
This is the Connector Name of the Email (Outgoing) connector that you wish to use to send the email.
|
subject
|
Required
|
This is the subject line of the generated email.
|
recipients
|
Required
|
These are any recipients of the generated email, provided either as an array of strings, or as a comma- or semicolon-separated string.
|
from
|
Optional
|
This is the address the email will appear to be sent from. If not provided, then the default specified in the connector itself will be used.
|
body
|
Required
|
This is the body of the email.
|
defer
|
Optional
|
This is the time to defer sending of the email to, specified either as a JavaScript date object or a string in the format "YYYY-MM-DD hh:mm:ss". If not provided, then the email will be sent immediately.
|
callback
|
Optional
|
This allows the provision of a "callback" function which will be executed once the email scheduling attempt has returned, allowing you to react to either successful or failing email scheduling.
|
Script.Email.Send(
"connector-email-outbound",
"Outbound Mail Example Connector",
[Email Subject],
"a.bc@example.com,d.ef@example.com",
"agent@example.com",
"Hi, this is a reminder for your appointment tomorrow...",
"2019-07-10 12:00",
function(response) { if(response.Error != "") { Script.Toast.Error("Email Failure", response.Error); } }
);
|
Script.Email.Send({
connectorType: "connector-email-outbound",
connectorName: "Outbound Mail Example Connector",
subject: [Email Subject],
recipients: ["a.bc@example.com", "d.ef@example.com"],
body: "Hi, to confirm the details of your recent enquiry...",
callback: function(response) { if(response.Error != "") { Script.Toast.Error("Email Failure", response.Error); } }
});
|