What macros can I use in an email?

What macros can I use in an email?

Macros within emails
You can use macros within emails by putting a #!# around the macro.

All the data field macros can be used as well. A full list of these is available at the link below:


These can be used to display different values in emails depending upon other order values. To do this you must use #!# around the macro to run. For example,

#!#[%ORD_GRAND_TOTAL%][<]10[Royal Mail][CityLink]#!#

[+]

The two values either side are added up

[-]

The value to the right is taken away from the value on the left.

[/]

The value on the left is divided by the value on the right.

[*] 

The two values are multiplied together.

[<]

Compares the value and if it is less than the value given value show the first value otherwise show the second value.

For example, to show Parcel Force for orders less than £100 and CityLink for

orders over and including £100 use:

[%ORD_SUB_TOTAL%] [<] 100 [Parcel Force] [CityLink]

[>]

Compares the value and if it is greater than the value given value show the first value otherwise show the second value.

For example, to alert someone (by adding text into a certain field) to check all orders over £200 use:

[%ORD_SUB_TOTAL%] [>] 200 [Check Order]

[=]

Compares the value and if it equals value given value show the first value otherwise show the second value. This can include text aswell as numeric values.

For example, to change the drop shipper depending upon a certain product use:

[%ITEM_SKU1%] [=] IL42 [SmartShipper][We Ship]

[U]

Make the field UPPERCASE. You should put the opertaor after the field value.

This can be useful for making certain fields more visible.

For example, to make the Delivery company name UPPERCASE use:

[%DEL_COMPANY%] [U]

[l]

Make the field lowercase. You should put the opertaor after the field value.This can be useful for making certain fields more readable when joined with other fields.

For example, to make the built up sentence (which is itself made up from other fields) more readable use:

[%CUSTOM_ENTERED1%]l]

[$] 

Display a portion of a field. The 2 values following the operator are the position to start in the text followed by the number of characters to use. This can be useful when values have to be a fixed length for certain export functions or using certain characters in a value as a code to another system.

For example, to use the first 3 characters of a product code as a warehouse location (or dropshipper) use the following. You can then base other fields on tests on this field.

[%ITEM_SKU1%][$][1][3]

If you put a ! before the second value you can take the portion of the string before the text given. For example, to include all the text before a space in the item title use the following:

[%ITEM_TITLE1%] [$][1][! ]

You can also search for certain words, not just single characters.

[.]

Take the absolute value of the number. For example, 19.21 would be shown as 19. This is very useful for any Inland Revenue figures where only the £ (GBP) number is required.

For example:
[%ORD_GRAND_TOTAL%] [.]

[#]

Replace a letter or word with another word. This can be useful if you wish to replace certain words (for branding) or to remove unwanted.

To replace the word Free with Additional use:
[%ITEM_TITLE1%] [#][Free][Additional]

To remove all commas from an address line:
[%INV_ADD_LINE1%] [#][,][]

[D]

Display the date (if a date field) in the format YYYY-MM-DD. This is useful when some export formats need the date in a different format. The formats supported are:

1 - yyyy-mm-dd
2 - dd/mm/yyyy
3 - dd/mm/yy
4 - mm/dd/yy

If you use nothing or 1 after the [D] it will use the format YYYY-MM-DD.

For example, to display the date as day/month/year use.

[%INV_DATE%] [D]2

[?]

Find a word within a field. If the text is found show the first value otherwise the second value. For example, to look for the word Fast in the shipping instructions use the following:

[%DELIVERY_INSTRUCTIONS%] [?]Fast[UPS][DHL]

This will display UPS if the word fast is used in the shipping instructions or DHL if it is not. This can be used to display order processing information based upon the order's choices.


    • Related Articles

    • How to display different logos in emails for different sales channels

      The best approach is to use an embedded macro in the html email text. To be easily read in emails, it is best to reference a logo on a website. For example, the following will display a different logo for Ebay, Amazon and your own eCommerce website ...
    • How to search for different values using macros

      You may want to have a macro (in a view, email or invoice) that tests for more than one value before generating an outcome. For example, if you want to provide a specific courier for all postcodes except certain specified area codes. This may be ...
    • How to include a conditional statement into a report using Macros

      The following guide explains how to include a conditional statement in a report using Macros This feature is available in the Lite, Professional, Premium and Managed subscriptions of One Stop Order Processing. Html templates contain many macros to ...
    • How to edit an email in One Stop Order Processing

      One Stop Order Processing allows you to change the content and format of the emails you send. Each email has a template file. You can edit the emails that are supplied with the system and you can add new ones. You can choose if you want emails to be ...
    • Sending emails from different email address' in One Stop Order Processing

      This feature is available in the Professional, Premium and Managed subscriptions of One Stop Order Processing. Adding the Printing Fields - 1. Click Options (The button with the 2 gears 2. Click on the Printing Fields tab 3.Click Add 4. Select ...