I have the below script that I am trying to upload but am getting a Fail to evaluate script: All SuiteScript API Modules are unavailable while executing your define callback - error.
Not sure what I am doing wrong as I am basically following the example in the api.
Note: This is being done in Sandbox.
/**
* @NApiVersion 2.x
* @NScriptType Suitelet
* @NModuleScope SameAccount
*/
define(['N/email'],
/**
* @param {email} email
*/
function(email){
function sendEmail() {
var senderId = 34972;
var recipientEmail = '[email protected]';
email.send({
author: senderId,
recipients: recipientEmail,
subject: 'Test Sample Email Module',
body: 'Thisis a test',
});
}
sendEmail();
});