Create a Plug-in Implementation Script File
You can use the SuiteCloud IDE, another JavaScript IDE, or a text editor to create a JavaScript file with the business logic for your Email Capture Plug-in implementation script file.
The following table describes the function and objects available in an Email Capture Plug-in implementation script file:
Function | Object |
Description |
---|---|
process(email) interface function |
Interface function that contains the implementation of the business logic of the Email Capture Plug-in. You can use JavaScript and SuiteScript API functions to define the business logic. This function is required for all Email Capture Plug-in implementations and NetSuite calls it automatically when someone sends a message to the email address associated with the plug-in implementation. For more information about how NetSuite uses this function, see Email Capture Process Flow. |
Email object |
Object that represents an email message sent to the Email Capture Plug-in implementation. Use the methods to retrieve the headers, date sent, subject, body, and attachment properties of an email message. |
Address object |
Object that represents data from the |
Attachment object |
Object that represents an attachment in an email message sent to an Email Capture Plug-in implementation. Each Attachment object contains properties for the file name, attachment type, and the value of the attachment file. |
The following diagram shows the object model for the Email interface input object:

Rules and Guidelines
Use the following rules and guidelines when creating the plug-in implementation script file:
-
The plug-in script file can have any name, provided it contains an implementation of the interface function.
-
If you want to create utility files with helper functions for the main implementation file, you can include them when you create the plug-in implementation for the Email Capture Plug-in in NetSuite. See Add the Plug-in Implementation.
-
You can use SuiteScript API functions in a plug-in implementation, for example, record.load(options) and search.create(options). However, using these APIs may slow the performance of the plug-in implementation, so limit the use of these APIs when possible. In general, searching for records yields better performance than loading them.
Governance limits apply to these functions too. The plug-in script file lets you use up to 1000 usage units with SuiteScript. For more information, see SuiteScript 2.x API Governance.
-
For security reasons, you can't send an email message to the Email Capture Plug-in from within NetSuite. You must use an external mail client. For example, you can't set up a script to send an email to the Email Capture Plug-in when a customer is created.