Create a Plug-in Implementation Script File
You can use the SuiteCloud IDE, or another JavaScript IDE or text editor, to create a JavaScript file that includes 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 is called automatically by NetSuite when an email is sent 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 available to the Email object 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 attachment 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, if 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 those files 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 negatively affect the performance of the plug-in implementation. You should limit the use of these APIs, where possible, to improve performance of the plug-in implementation. In general, searching for records yields better performance than loading NetSuite records.
Governance limits also apply to these functions. The plug-in script file allows up to 1000 usage units when used with SuiteScript. For more information, see SuiteScript 2.x API Governance.
-
For security reasons, you are not permitted to send an email message to the Email Capture Plug-in from within NetSuite. You can only send a message to the Email Capture Plug-in using an external mail client. For example, it is not possible to submit a script upon customer creation, to send an email to the Email Capture Plug-in.