How to Create a Text or XML File

Order Desk provides a sample receipt template and the ability to create custom order documents out of the receipt. Use the Sample XML template or create your own, and Order Desk can create a text or XML order document file.

Follow the steps in this guide to learn how to create your own XML files in Order Desk. For more information on working with Order Documents, see this guide.

IN THIS GUIDE

Create Order Document Template
Create Rule
Order Metadata Link
Attach File to Email Template

Create Order Document Template

To create a receipt template, click on Templates in the Settings menu in the left sidebar. Under the Order Documents section, click on Add New Receipt Template.

The default receipt template will be added.

Delete this code and replace it with the Sample XML template, or you can write your own template if you prefer.

Sample XML Template

Copy the code from this template to paste into your Order Document, rename the template and then click Add New Template to save it, like so:

Create Rule

Once your template has been created, head into the Rule Builder to to create a rule that will add the XML file to your orders.

To create your rule, start with the Order Rule Rule Type. The event can be whatever you need to set it to, but for this example, we'll use Order is Imported.

Under Filters & Actions, choose the Create Text File action and select your XML template from the dropdown:

Now, whenever an order is imported, the XML file will be created and applied to the order metadata.

For more information on working with the Rule Builder, including how to use different events and set filters so the Rule Builder knows which orders to apply the Create Text File action to, see this guide.

Order Metadata Link

To find the link to your file, look down at the bottom of the order details page in the Order Metadata section. The file will be added under txt_xxx, where xxx is the template ID, which can be found in the URL of the template you created in the first step:

Attach File to Email Template

To add the file as an email attachment, get the file value from the order metadata as described in the last step.

Add this to the  Attachment Field Names field in the email template where you would like it to be an attachment:

Multiple field names can be entered if separated by comma.

For more information on working with email templates, please see this guide.

Still need help? Contact Us Contact Us