HEllo All, I want to send email to a specific empl...
# general
v
HEllo All, I want to send email to a specific employees. I need to do it thru script parameters. But i dont know how to do it as this is my first time. could anyone please help me?
p
Copy code
var senderId = -5;
var recipientEmail = '<mailto:notify@myCompany.com|notify@myCompany.com>';
var timeStamp = new Date().getUTCMilliseconds();
var recipientId = 12;
var fileObj = file.load({
    id: 88
});
email.send({
    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
                  }
      }
});
v
👍