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 from, to, cc, or reply-to headers in an email message sent to an Email Capture Plug-in implementation.

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:

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:

Related Topics

General Notices