Configure Inbound Invoice Routing
Resolve Inbound Email Rejection from NetSuite Vendors
Last updated
Was this helpful?
Resolve Inbound Email Rejection from NetSuite Vendors
Last updated
Was this helpful?
Customers using the SquareWorks Invoice Email Capture functionality may experience issues when invoices from Vendors also using NetSuite are sent. This is due to the configuration of NetSuite’s own Inbound Email plugin, designed to prevent infinite “looping” between two NetSuite instances.
To resolve this issue, users can configure their email client to forward the invoices to their NetSuite account. Vendors would then send invoices to this non-NetSuite account, which will then automatically forward the invoice to NetSuite, effectively creating an intermediary step to bypass the NetSuite plugin controls.
Configuring in Outlook:
Within Outlook, create a rule to automatically forward all emails received from a NetSuite account:
Note: Configure the rule to check for the X-NetSuite header (as shown above) so only messages originating from NetSuite get forwarded. This assumes that any non-NetSuite emails are already being handled via separate forwarding configurations.
Configuring in Gmail:
Gmail has a built-in automatic forwarding feature, but emails forwarded in this way will not appear in your NetSuite inbox if they originate from a NetSuite account. To ensure these emails are forwarded correctly, follow these steps:
Setup email forwarding in Gmail
Verify that your Gmail inbox is already configured to forward all emails to your NetSuite inbound email address. If not setup, configure Gmail to forward email addresses to NetSuite before proceeding.
Create a new Google Apps Script project:
Go to and create a new project. Name it “Forward NetSuite Emails”.
Replace the default code with the script below: Note: Update the email address in the script (netsuite-inbound-email@your-account.email.netsuite.com) to your actual NetSuite inbound email address.
Enable the Gmail API: In the Apps Script editor, click the + next to Services and add the Gmail API.
Authorize the script:
Click Run to test the script.
When asked to authorize, click Review permissions, then select your account.
If you see a warning about unverified apps, click Advanced and proceed with “Go to Forward NetSuite Emails (unsafe)”
The script will search the Gmail inbox for messages from NetSuite in the past 24 hours, forward them to your NetSuite inbox address, and label them “Forwarded.” Any labeled emails will be ignored in subsequent runs.
Set up a time-driven trigger:
Open the Triggers page in the Apps Script editor.
Click Add Trigger and choose:
Choose which function to run: forwardNetSuiteEmails
Choose which deployment should run: Head
Select event source: Time-driven
Select type of time based trigger: Hours timer
Select minute interval: Every hour
This trigger will run the script automatically on an hourly basis.