# How to automate inbound email into Priority ERP

> Source: https://netray.co/integrations/priority-email-automation
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: Integrations

## Short answer

Read a shared mailbox through Microsoft Graph or IMAP, classify and extract each message, match it to Priority customers, suppliers and parts, and load it as a draft through the API or a Priority load interface. A person reviews anything below a confidence threshold.

## System

Priority ERP

## Capability

email-automation

## Intro

In most Priority shops, orders still arrive by email: a customer PO as a PDF, a spreadsheet with line items, or a plain message saying 'same as last time, 500 more'. Someone in customer service opens it and keys a sales order, and the same thing happens with supplier acknowledgments and RFQ replies.

Priority has strong import tooling, which is the useful part here. Its interfaces load data into tables with the same business rules as manual entry, so the email project is mostly about producing clean, matched input and routing exceptions, not about bypassing the system.

This page focuses on the mailbox-to-Priority pipeline, the matching problems unique to ERP master data, and the review queue that makes it safe.

## Use Cases

### Customer PO emails to draft sales orders

**Description:** Extract customer, PO number, parts, quantities, prices and requested dates, match to customer and part master, and create a draft order for review.

### Supplier order acknowledgments

**Description:** Read acknowledgment emails, find the purchase order, and propose updated confirmed dates for the buyer to accept.

### RFQ requests from customers

**Description:** Turn a request for quote into a draft price quote with matched parts and flagged unknowns, ready for the estimator.

### Invoice emails to accounts payable

**Description:** Route invoice attachments into the capture flow and match them to open purchase orders and receipts.

### Shipping notice and delay emails

**Description:** Pick up carrier and supplier notices, link them to deliveries or purchase orders, and add a note or alert the planner.

## System Surface

- Priority OData REST API for reading customers, parts, price lists and open orders for matching, and for creating draft documents.
- Priority interfaces, which load rows into a target form's tables with validation; typically driven from a staging table or file and configurable per document type.
- Priority's own mail functions and attachments on documents, useful for storing the original email or PDF against the order for audit.
- Part cross-reference and customer-specific part number tables, where available, which are the key to matching customer part numbers to your internal ones.
- Document status and approval flow, which lets you land the load in a draft status that normal users must finalize.

## How It Works

### Connect to the mailbox

**Detail:** Use Microsoft Graph with application permissions limited to one shared mailbox, or IMAP with an app password. Move processed mail to folders rather than deleting.

### Classify the message

**Detail:** Sort into PO, acknowledgment, RFQ, invoice, other. Start with sender and keyword rules and add a model for the long tail.

### Extract the fields

**Detail:** Parse attachments (PDF, Excel, CSV) and the body into a common structure with confidence per field. Spreadsheet formats from repeat customers can be handled with fixed mappings.

### Match to master data

**Detail:** Resolve the sender to a customer, map customer part numbers through cross-references, and check price against the customer's price list. Anything unmatched goes to review.

### Stage and load

**Detail:** Write matched results to a staging table and use the API or a load interface to create a draft order with the original email attached.

### Review queue

**Detail:** Show low-confidence lines side by side with the source, let the user fix mappings, and learn the fix as a stored cross-reference for next time.

## Example Flows

### PDF purchase order from a repeat customer

**Trigger:** An email with a PO attachment arrives in the orders mailbox.

**Steps:**

- The sender domain and customer reference identify the account.
- The PDF is parsed into header and line items.
- Customer part numbers are mapped through the cross-reference table.
- Price differences against the price list are flagged.
- A draft sales order is created and the email stored as an attachment.

**Result:** A clean PO becomes a draft in under a minute, and a clerk only checks flagged lines.

### Supplier acknowledgment with new date

**Trigger:** A supplier replies to a PO with revised dates.

**Steps:**

- The PO number is found in the subject or body.
- Lines and dates are extracted and compared with the open PO.
- Date changes beyond a tolerance create a proposal row for the buyer.
- The buyer accepts, and the confirmed date is updated in Priority.

**Result:** Buyers see date slips on one screen instead of hunting through inboxes.

## On Prem

Email content and ERP master data are both commercially sensitive, so keep extraction on infrastructure you control. Run the pipeline next to Priority, read the mailbox through a narrowly scoped account, and use an open-weight model on local GPUs for classification and extraction rather than sending customer POs to a third-party API. Store raw emails in your own file share, keep the staging table in your database, and expose nothing inbound. If your mail is in a cloud tenant, only the mailbox API call crosses the boundary.

## Security

- Limit mailbox access to one shared mailbox with a scoped application permission or dedicated account.
- Treat email as untrusted input: scan attachments, strip active content and guard against prompt injection in message bodies.
- Never auto-finalize financial documents; land drafts and require a human to release.
- Verify sender identity beyond display name, using domain checks and known contact lists, to resist spoofed POs.
- Retain the original message with the draft for audit and dispute resolution.

## Options

### Priority load interface plus rules

**Fit:** Works for customers who send structured spreadsheets in a stable layout.

**Effort:** Days per customer template.

### Commercial order-capture product

**Fit:** Suitable if volume is high and the vendor supports your Priority version and local-language documents.

**Effort:** Weeks of onboarding plus subscription cost.

### Custom pipeline with a partner like Netray

**Fit:** Good when formats vary, data must stay private, and you want cross-reference learning and an on-prem model.

**Effort:** Pilot on one mailbox in a few weeks, then widen.

## Pitfalls

- Trusting a sender name instead of the domain, which opens the door to fake POs.
- Skipping customer part cross-references, which creates the most common mismatch.
- Auto-creating customers or parts from unmatched emails and polluting master data.
- Reprocessing the same email after a retry and creating duplicate drafts; use the message id as an idempotency key.
- Ignoring replies and threads, where the latest message may change quantities of an earlier PO.

## Faq

### Can Priority import orders from email by itself?

**Answer:** Priority has strong import interfaces but I would not assume native email parsing for free-form messages in your version. A separate pipeline normally reads and extracts the email, then feeds the data into Priority through the API or an interface.

### Should the system create orders automatically?

**Answer:** Create drafts, not finalized orders, at least until you have weeks of measured accuracy. Auto-release can be considered for a small set of trusted customers with exact part and price matches, with periodic sampling.

### How accurate is extraction from PDFs?

**Answer:** It varies by layout quality and customer. Clean digital PDFs from repeat customers are far easier than scans or free-text emails. Measure on your own mail for a few weeks and set thresholds from the results rather than a vendor claim.

### Does the original email stay with the order?

**Answer:** It should. Attach the message and its attachments to the draft document so the reviewer and later auditors can compare the order to the source. Store a link or hash if you keep raw mail outside Priority.

### Can this run without sending mail to a cloud AI?

**Answer:** Yes. Classification and extraction can be done with open-weight models on local GPUs, with the mailbox read by a scoped account. Smaller layouts are often handled with rules and templates, with the model reserved for the messy cases.

## Search terms

priority erp email automation, automate purchase orders email priority erp, priority software email to sales order, priority erp rfq email, priority erp order entry automation, priority erp email parsing, priority erp supplier acknowledgment email, priority erp load interface email, priority erp inbox automation

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
