Aurora API: Order Email (API Versions > 1.3)
Order Email
Using this controller you can add, edit, delete and retrieve all Order Email templates.
Add
Deferred: No
Example Request:
<?xml version="1.0" encoding="utf-8"?>
<AuroraRequestEnvelope>
<Header>
<AuthToken>...</AuthToken>
</Header>
<Requests>
<Request>
<Order>
<Email>
<Add>
<Type>return_authorised</Type>
<Name>Return Approved</Name>
<Subject>Your return has been approved</Subject>
<Content>Have a nice day!</Content>
</Add>
</Email>
</Order>
</Request>
</Requests>
</AuroraRequestEnvelope>
Example Response:
<?xml version="1.0" encoding="utf-8"?>
<AuroraResponseEnvelope>
<Header>
<Summary>
<Ack>OK</Ack>
<RequestsProcessed>1</RequestsProcessed>
<RequestsSucceeded>1</RequestsSucceeded>
<RequestErrors>0</RequestErrors>
</Summary>
</Header>
<Responses>
<Response>
<RequestID>1</RequestID>
<Ack>OK</Ack>
<Data>
<EmailID>34</EmailID>
</Data>
</Response>
</Responses>
</AuroraResponseEnvelope>
Update
Deferred: No
The 'Update' call is almost identical to the 'Add' call with the only real difference being that most of the fields are now optional. While adding a new item requires that you provide all necessary information at once, when using the 'Update' method, you can just provide the information you wish to change and leave out all of the rest (excluding the relevant ID fields of course which are used to identify the records to be updated).
Example Request:
<?xml version="1.0" encoding="utf-8"?>
<AuroraRequestEnvelope>
<Header>
<AuthToken>...</AuthToken>
</Header>
<Requests>
<Request>
<Order>
<Email>
<Update>
<EmailID>34</EmailID>
<Content>Have a nice day! The team.</Content>
</Update>
</Email>
</Order>
</Request>
</Requests>
</AuroraRequestEnvelope>
Example Response:
<?xml version="1.0" encoding="utf-8"?>
<AuroraResponseEnvelope>
<Header>
<Summary>
<Ack>OK</Ack>
<RequestsProcessed>1</RequestsProcessed>
<RequestsSucceeded>1</RequestsSucceeded>
<RequestErrors>0</RequestErrors>
</Summary>
</Header>
<Responses>
<Response>
<RequestID>1</RequestID>
<Ack>OK</Ack>
<Data>
<EmailID>34</EmailID>
</Data>
</Response>
</Responses>
</AuroraResponseEnvelope>
Delete
Deferred: No
Example Request:
<?xml version="1.0" encoding="utf-8"?>
<AuroraRequestEnvelope>
<Header>
<AuthToken>...</AuthToken>
</Header>
<Requests>
<Request>
<Order>
<Email>
<Delete>
<EmailIDs>
<EmailID>416</EmailID>
</EmailIDs>
</Delete>
</Email>
</Order>
</Request>
</Requests>
</AuroraRequestEnvelope>
Example Response:
<?xml version="1.0" encoding="utf-8"?>
<AuroraResponseEnvelope>
<Header>
<Summary>
<Ack>OK</Ack>
<RequestsProcessed>1</RequestsProcessed>
<RequestsSucceeded>1</RequestsSucceeded>
<RequestErrors>0</RequestErrors>
</Summary>
</Header>
<Responses>
<Response>
<RequestID>1</RequestID>
<Ack>OK</Ack>
<Data/>
</Response>
</Responses>
</AuroraResponseEnvelope>
Request Fields
Field | Values | API Version | Description | Required |
---|---|---|---|---|
EmailIDs | Container | 1.4+ | No | |
EmailIDs.EmailID | Integer | 1.4+ | The ID of the Email to delete. | Only if 'EmailIDs' is provided |
Get
Deferred: No
Records returned by this call are currently always ordered by the date they were created. This may change, so you should consider specifying the sort order of your results if this is going to effect your systems performance in the future.
The 'tracking' attribute can be used to denote whether or not tracking should be enabled, please see Request Tracking for more details.
Example Request:
<?xml version="1.0" encoding="utf-8"?>
<AuroraRequestEnvelope>
<Header>
<AuthToken>...</AuthToken>
</Header>
<Requests>
<Request>
<Order>
<Email>
<Get>
<Limit>100</Limit>
<Paging>
<Limit>2</Limit>
<Page>1</Page>
</Paging>
</Get>
</Email>
</Order>
</Request>
</Requests>
</AuroraRequestEnvelope>
Example Response:
<?xml version="1.0" encoding="utf-8"?>
<AuroraResponseEnvelope>
<Header>
<Summary>
<Ack>OK</Ack>
<RequestsProcessed>1</RequestsProcessed>
<RequestsSucceeded>1</RequestsSucceeded>
<RequestErrors>0</RequestErrors>
</Summary>
</Header>
<Responses>
<Response>
<RequestID>1</RequestID>
<Ack>OK</Ack>
<Paging>
<Token>79b4547ad3985e4431a1831fcd8a1a22685</Token>
</Paging>
<Data>
<Order>
<Email>
<EmailID>2</EmailID>
<Type>failed_order</Type>
<Name>Failed Orders</Name>
<Subject language="en-gb">{$firstname} please contact us!</Subject>
<Content language="en-gb">This is a test.</Content>
<DateCreated>2011-01-26 20:03:05</DateCreated>
</Email>
<Email>
<EmailID>3</EmailID>
<Type>return_authorised</Type>
<Name>Authorised Returns</Name>
<Subject language="en-gb">Returns Request Accepted</Subject>
<Content language="en-gb">This is another test.</Content>
<DateCreated>2011-01-26 20:03:05</DateCreated>
</Email>
</Order>
</Data>
</Response>
</Responses>
</AuroraResponseEnvelope>
Request Fields
Field | Values | API Version | Description | Required |
---|---|---|---|---|
EmailIDs | Container | 1.4+ | No | |
EmailIDs.EmailID | Integer | 1.4+ | The ID to restrict the result to. | Only if 'EmailIDs' is provided |
DetailLevel | Detail Levels | 1.4+ | This allows the client to request varying volumes of data when receiving data back from the server. | No |
Language | "all" or language ISO | 1.4+ | This allows the client to request specific or all languages to be returned. If not included in the request the default language will be returned. | No |
Tracking | Request Tracking | 1.4+ | If this is set to 'unsent' then any orders previously retrieved via the current API account while 'tracking' was active will be excluded from the results. This allow for unique order exports to be set-up easily to avoid duplicate orders being downloaded. | No |
Limit | Integer > 0 | 1.4+ | The number of records to return | No |
Paging | Container | 1.4+ | See Paging | No |
Paging.Token | String | 1.4+ | This is the Token string issued from any previous Get call featuring paging. Providing this will have the API collect the data from the previously generated set of data, ensuring accurate and consistent dataset results for every page. You cannot change the request properties previously provided when using a Token, so these are ignored by the API. | No |
Paging.Limit | Integer > 0 | 1.4+ | The number of results to return in the page being requested | No |
Paging.Page | Integer > 0 | 1.4+ | The page number to return the results for | Only if 'Token' is provided |
Send
Deferred: No
This method is intended to allow third parties to trigger genuine Aurora emails over the API. This is most commonly used for sending confirmation emails after adding new orders, but can be used to send any pre-configured email template or even custom messages from Aurora to a customer.
Example request:
<?xml version="1.0" encoding="utf-8"?>
<AuroraRequestEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Header>
<AuthToken>...</AuthToken>
</Header>
<Requests>
<Request>
<Order>
<Email>
<Send>
<RequestID>1</RequestID>
<OrderID>1234</OrderID>
<Template>System: Order Confirmation</Template>
</Send>
</Email>
</Order>
</Request>
</Requests>
</AuroraRequestEnvelope>
Example response:
<?xml version="1.0" encoding="utf-8"?>
<AuroraResponseEnvelope>
<Header>
<Summary>
<Ack>OK</Ack>
<RequestsProcessed>1</RequestsProcessed>
<RequestsSucceeded>1</RequestsSucceeded>
<RequestErrors>0</RequestErrors>
</Summary>
</Header>
<Responses>
<Response>
<RequestID>1</RequestID>
<Ack>OK</Ack>
<OrderID>695657</OrderID>
<Email>
<Subject>Aurora Demo: A message regarding your order</Subject>
<Reference>5fa4dd21ae1e8b2b86e0d3b43dbdf6a4</Reference>
</Email>
</Data>
</Response>
</Responses>
</AuroraResponseEnvelope>
The 'Reference' field can be used to view the email in a browser and is often provided to the customer to support the 'Having trouble viewing this email in your email client' feature. To use this code to view the content of the email sent to the customer, simply add it the the end of the URL '/emails/?ref='.
For example:
http://www.example.com/emails/?ref=5fa4dd21ae1e8b2b86e0d3b43dbdf6a4
Updated over 2 years ago