XML Elements

XML metadata file containing a pack root element and letters.

<?xml version="1.0" encoding="UTF-8"?>
<pack>
	<letters>
		<letter>...</letter>
    …
		<letter>...</letter>
	</letters>
</pack>

Simple Letter.

<?xml version="1.0" encoding="UTF-8"?>
<pack>
	<letters>
		<letter>
			<postal>
				<line>Mr. Smith</line>
				<line>3231 Golden Rd</line>
				<line>WESTLEIGH  NSW  2120</line>
			</postal>
		</letter>
	</letters>
</pack>

Using the files element.

    <letter>
    …
	<files>
		<file>
			<file_name>letter.pdf</file_name>
			<page_start>0</page_start>
			<page_end>3</page_end>
		</file>
		<file>
			<file_name>attachment.pdf</file_name>
		</file>
	</files>
	</letter>

Simple XML Examples

In the case where a single document is uploaded with its associated metadata file, no filename reference is required. If more than 1 document is uploaded then each document should either be marked as attachments, to go to all recipients, or referenced as a file within a letter.  If neither is done then only the 1st uploaded document will be used.

1. Document uploaded with metadata - Single personalised or non-personalised letter, name and address assembled.
This example shows address data already assembled into address lines. It also shows optional duplex, colour, confirmation email and department options (at pack level).

<?xml version="1.0" encoding="UTF-8"?>
<pack>
	<duplex>true</duplex> //optional - true or false. Default is false
	<colour_model>1</colour_model> //optional. Default is 1 – full colour.
	<confirmation_email>true</confirmation_email> //optional email confirmation
	<customer_email>inbox@example.com</customer_email> //email address for confirmation
	<department>Accounts</department> //optional department name
	<letters>
		<letter>
			<postal>
				<line>Mr T Smith</line>
				<line>23 Henry St</line>
				<line>Somewhere NSW 2345</line>
			</postal>
		</letter>
	</letters>
</pack>

2. Single personalised or non-personalised letter, name and address as elements.

<?xml version="1.0" encoding="UTF-8"?>
<pack>
	<letters>
		<letter>
			<postal>
				<line>Mr T Smith</line>
				<line>23 Henry St</line>
				<line>
					<locality>SAMPLEVILLE</locality>
					<state>NSW</state>
					<postcode>9999</postcode>
				</line>
			</postal>
		</letter>
	</letters>
</pack> 

3. In this example a document is sent to multiple recipients.

<?xml version="1.0" encoding="UTF-8"?>
<pack>
	<letters>
		<letter>
			<postal>
				<line>Recipient 1</line>
				<line>23 Henry St</line>
				<line>Somewhere NSW 2345</line>
			</postal>
			<reference>ABC00001</reference>
		</letter>
		<letter>
			<postal>
				<line> Recipient 2</line>
				<line>24 Henry St</line>
				<line>Somewhere NSW 2345</line>
			</postal>
			<reference>DEF00002</reference>
		</letter>
		<letter>
			<postal>
				<line> Recipient 3</line>
				<line>25 Henry St</line>
				<line>Somewhere NSW 2345</line>
			</postal>
			<reference> GHI00003</reference>
		</letter>
	</letters>
</pack>

Full XML Example

The next examples use all the fields for completeness. In a real submission most of the fields can be omitted.

<?xml version="1.0" encoding="utf-8"?>
<pack>
	<duplex>true</duplex>
	<colour_model>1</colour_model>
	<title>Example XML</title>
	<customer_email>z@b.com.au</customer_email>
	<confirmation_email>true</confirmation_email>
	<department>Invoices</department>
	<purchase_order>PO_1234</purchase_order>
	<terminal>host_007</terminal>
	<cust_hold>true</cust_hold>
	<orientation>1</orientation>
	<production_options>
		<c4_staple>false</c4_staple>
		<force_c4>false</force_c4>
		<aup_dlvtyp>0</aup_dlvtyp>
		<archive>false</archive>
	</production_options>
	<attachments>     
		<attachment>attachment.pdf</attachment>
	</attachments>     
	<letters>
		<letter>
			<postal>
				<line>John Smith</line>
				<line>3 Gold Rd</line>
				<line>
					<locality>WESTLEIGH</locality>
					<state>NSW</state>
					<postcode>2102</postcode>
				</line>
				<line>
					<country>AUS</country>
				</line>
			</postal>
			<primary>postal</primary>
			<reference>REF1</reference>
			<custom_data>
				<CustomField1>CustomVal1</CustomField1>
				<Custom2>CustomVal2</Custom2>
			</custom_data>
			<file_name>letters.pdf</file_name>
			<page_start>0</page_start>
			<page_end>0</page_end>
		</letter>
		<letter>
			<fax>012345678</fax>
			<postal>Smith Jones
			33 Gold Rd
			WESTLEIGH NSW 2102</postal>
			<primary>fax</primary>
			<files>
				<file>
					<file_name>letters.pdf</file_name>
					<page_start>1</page_start>
					<page_end>1</page_end>
				</file>
				<file>
					<file_name>attachment.pdf</file_name>
				</file>
			</files>
		</letter>
	</letters>
</pack>