> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: sendFulfillmentEmail(orderId: string, fulfillerId: string) # Method package: wixStoresBackend # Method menu location: wixStoresBackend --> sendFulfillmentEmail # Method Link: https://dev.wix.com/docs/velo/apis/wix-stores-backend/send-fulfillment-email.md # Method Description: Sends a fulfillment email to a specified custom fulfiller of a line item in a given order. The `sendFulfillmentEmail()` function returns a Promise that is resolved when the fulfillment email for the specified order is sent to the specified custom fulfiller. A custom fulfiller is a fulfiller that is not integrated with the Wix App Market. Learn more about [Connecting Your Wix Store to a Fulfillment Service](https://support.wix.com/en/article/connecting-your-wix-store-to-a-fulfillment-service). # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Send a fulfillment email to a custom fulfiller ```javascript /*********************************** * Backend code - fulfillments.jsw * ***********************************/ import wixStoresBackend from 'wix-stores-backend'; export function sendFulfillmentEmail(orderId, fulfillerId) { return wixStoresBackend.sendFulfillmentEmail(orderId, fulfillerId); } /************** * Page code * **************/ import { sendFulfillmentEmail } from 'backend/fulfillments'; export function button1_click(event) { $w("#thankYouPage1").getOrder() .then((order) => { sendFulfillmentEmail(order._id, order.lineItems[0].fulfillerId) .then(() => { // Fulfillment email sent }) .catch((error) => { // Fulfillment email not sent console.log(error); }); }); } ``` ## Send a fulfillment email to fulfillers of unfulfilled orders ```javascript import wixStoresBackend from 'wix-stores-backend'; import wixData from 'wix-data'; wixData.query("Stores/Orders") // Find all unfulfilled orders .eq("fulfillmentStatus", "NOT_FULFILLED") .find() .then((results) => { const unfulfilledOrders = results.items; unfulfilledOrders.forEach((order) => { // Find unfulfilled orders with line items associated with a custom fulfiller (have a fulfillerId) const fulfillerIds = order.lineItems.map(lineItem => lineItem.fulfillerId); fulfillerIds.forEach((fulfillerId) => { if (order._id && fulfillerId) { // Send a fulfillment email to each unfulfilled custom fulfiller wixStoresBackend.sendFulfillmentEmail(order._id, fulfillerId) .then(() => { // Fulfillment email sent }) .catch((error) => { // Fulfillment email not sent console.log(error); }); }; }); }); }) ``` ---