WooCommerce new-order emails
Parse WooCommerce order emails
WooCommerce sends the shop admin a new-order email with a table of products. This layout reads the order details and turns each row of that table into a line item.
Use this layoutFree plan included: 2 layouts per endpoint.
- From
- Acme Store <wordpress@acme-store.example>
- Subject
- [Acme Store]: New order #2187
You've received the following order from Jane Doe: [Order #2187] (October 29, 2026) Product Quantity Price Linen shirt 2 $78.00 Canvas tote 1 $24.00 Subtotal: $102.00 Shipping: $6.00 via Flat rate Payment method: Credit card Total: $108.00
{
"parsed": {
"status": "matched",
"layout": {
"id": "woocommerce-orders",
"name": "WooCommerce orders"
},
"fields": {
"order": "2187",
"customer": "Jane Doe",
"payment": "Credit card",
"total": "108.00"
},
"lineItems": [
{
"product": "Linen shirt",
"quantity": "2",
"price": "78.00"
},
{
"product": "Canvas tote",
"quantity": "1",
"price": "24.00"
}
]
}
}The layout
It matches the email by its subject, reads each field with an RE2 pattern, and turns the list into line items. Edit any of it in the endpoint's settings, where the preview tries it on an email you captured as you type.
{
"id": "woocommerce-orders",
"name": "WooCommerce orders",
"match": {
"conditions": [
{
"field": "email",
"name": "subject",
"op": "contains",
"value": "New order #"
}
]
},
"fields": [
{
"name": "order",
"from": "subject",
"pattern": "#(\\d+)"
},
{
"name": "customer",
"from": "html",
"pattern": "order from ([^\\r\\n:]+):"
},
{
"name": "payment",
"from": "html",
"pattern": "Payment method:[ \\t]*([^\\r\\n]+)"
},
{
"name": "total",
"from": "html",
"pattern": "Total:\\s*\\$?([0-9][0-9.,]*)"
}
],
"lineItems": {
"from": "html",
"start": "Product Quantity Price",
"end": "Subtotal:",
"pattern": "(?m)^(?P<product>.+?) (?P<quantity>\\d+) \\$?(?P<price>[0-9][0-9.,]*)$"
}
}