email.send.promise(options)
Method Description |
Sends email asynchronously to an individual or group of recipients and receives bounceback notifications.
Note:
The parameters and errors thrown for this method are the same as those for email.send(options). For more information about promises, see Promise Object. |
Returns |
|
Synchronous Version |
|
Supported Script Types |
Client scripts For additional information, see SuiteScript 2.x Script Types. |
Governance |
20 units |
Module |
|
Since |
2015.2 |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete promise script example, see Promise Object.
//Add additional code
...
var senderId = -5;
var recipientEmail = 'notify@myCompany.com';
var timeStamp = new Date().getUTCMilliseconds();
var recipientId = 12;
var fileObj = file.load({
id: 88
});
email.send.promise({
author: senderId,
recipients: recipientId,
subject: 'Test Sample Email Module',
body: 'email body',
attachments: [fileObj],
relatedRecords: {
entityId: recipientId,
customRecord:{
id:recordId,
recordType: recordTypeId //an integer value
}
}
}).then (function(result) {
// Process the result
});
...
//Add additional code