How To: Setup 'Your Order has Shipped' Invoice Emails

There are two steps to creating emails that are automatically created and sent as a result of orders moving from one stage in the Sales Invoice Manager, for example shipping, to another such as invoice:

  1. Setup the Message Template
  2. Setup the Trigger Rule

Note: the Document Rules generate an email when a customer has the following set-up against them:
  • When the customer's invoice contact has an e-mail address.
  • When there is no email address for the invoice contact the invoice address' email address will be used.

Setup the Message Template

  1. Open an Email Manager screen (show me how).
  2. Click in the Message Templates radio button to display existing message templates.
  3. Press Ctrl+N or click the New item icon is the button bar's NEW button .
  4. Add a template code in the Template Code.
  5. Add a template description in the Template Desc field.
  6. Select INVOICE from the Trigger Type drop-down.
  7. In the Options section tick as required:
    • Enter the brand email address, if setup and using, in the Use Brand Email Address field.
    • Tick the Show Pack Children checkbox if pack children should be displayed in the email body.
    • If you want to add an entry into the contact's Comm Log when the email has been sent then tick the Add to Comm Log when sent checkbox.
    • Tick the HTML Format checkbox if the email is formatted using HTML.[1][2]
  8. If not using the default from address then insert a replacement email address in the From field.
  9. Add a Subject for the email, for example Your items have shipped.
    Note: you can add tags into the Subject area by selecting them and using the upper BtnEmailArrow.jpg button.
  10. Build the Item Template to show stock items being shipped by adding the relevant tags with the blue background to the Item Template field using the adjacent BtnEmailArrow.jpg button.
  11. Build the To Follow Item Template (if using) to show stock items that are being shipped separately by adding the relevant tags with the blue background to the To Follow Item Template field using the adjacent BtnEmailArrow.jpg button.
  12. Add the body of the email into the Message Template. The available tags to the right can be added into the body of the message are details that can be taken from the invoice, for example, tag $COMPANY_NAME will print out the name of the company that the invoice is for when the email is generated. They are added by double clicking the tag which is introduced into the message text at the cursor position, for an example see Example of a Shipped Email Message Template. [3]
    • Add the yellow $ITEM_TEXT tag where you wish the list of items being shipped to be placed in the email body.
    • Add the yellow $TO_FOLLOW_ITEM_TEXT tag (if using) where you wish the list of items on the sales order but not being shipped with this shipment.
  13. Press Ctrl+S or click the disk icon is the button bar's SAVE button to save the Message Template. For an example of the resulting template see shipped email example.

Notes

  1. ? For formatting the email body including adding images see How To: Insert an Image into an Email
  2. ? If using the $BOXES_CONSIGNMENT_REF tag which supersedes the $CONSIGNMENT_REF option then the HTML checkbox MUST be ticked so that the recipient receives an email with a clean and clear hyperlink to click through in order to track their parcel. This tag adds the Courier URL from [ System Data | Couriers ] and consignment reference in automated despatch emails to customers. Where an invoice has been packed into more than one box, this tag will display the individual consignment references generated (including URLs, if specified in [ System Data | Couriers ]), with a line break between each one, see How To: Setup Email Consignment References for Boxes.
  3. ? Linking to courier websites can be done by including the tracking reference $CONSIGNMENT_REF and the link to the courier website in the message body. For advanced functionality using conditional text see Adding Conditional Courier and Consignment Text below.


Adding Conditional Courier and Consignment Text


WARNING icon
Using conditional text in Message Templates is an Advanced User feature.

For more information see How To: Use DECODE in Email Manager.

Notes:

  1. Using IF statements and conditional text is possible but not user friendly. The statements are formatted using XML.
  2. "Equals" is the only supported operator at present.
  3. This functionality does not work when nested inside each another tag structure.
  4. If you need to do different actions for other couriers you will need to add a condition for each matching courier text.
  5. If you need help with other examples please email Support.
Example One - Match on One Property of the Courier

Example one uses the COURIER_TYPE which is the information defined in the Courier Name column in [ System Data | Sales Order Processing | Couriers ] screen.

The following will check if the COURIER_TYPE matches against the text CityLink:

  1. If true it will add the fictitious URL for citylink tracking.
  2. If False it will add the text
    "leave this blank to ignore other couriers".
  3. If an error occurs then it will add the text:
    "leave this blank to ignore errors".

<DECODE value1="&dollar;COURIER_TYPE" operator="equals" value2="CityLink" 
 trueText="Look here to track your order: www.citylinkexample.com/track?=&dollar;CONSIGNMENT_REF" 
 falseText="leave this blank to ignore other couriers" 
 errorText="leave this blank to hide errors"></DECODE>

Note: if using the &dollar;BOXES_CONSIGNMENT_REF tag then the second line above should be:

 trueText="Look here to track your order: &dollar;BOXES_CONSIGNMENT_REF"

This will pull the appropriate Courier URL from [ System Data | Couriers ] and add the consignment reference at the end for each box being shipped. To set this up see How To: Setup Email Consignment References for Boxes.

Example Two - Match on Two Properties of the Courier

Example two uses:

  1. The COURIER_CODE which is the information defined in the Code column in [ System Data | Sales Order Processing | Couriers ] screen and
  2. the COURIER_TYPE which is the information defined in the Courier Name column in [ System Data | Sales Order Processing | Couriers ] screen.

The following will check if the COURIER_TYPE matches against the text CityLink and COURIER_CODE matches the Code held against the courier in [ System Data | Sales Order Processing | Couriers ]:

  1. If true it will add the fictitious URL for citylink tracking.
  2. If False it will add the text
    "leave this blank to ignore other couriers".
  3. If an error occurs then it will add the text:
    "leave this blank to ignore errors".

<DECODE value1="&dollar;COURIER_CODE" operator="equals" value2="CityLink" 
 trueText="Look here to track your order: www.citylinkexample.com/track?=&dollar;CONSIGNMENT_REF" 
 falseText="leave this blank to ignore other couriers" 
 errorText="leave this blank to hide errors"></DECODE>

<DECODE value1="&dollar;COURIER_TYPE" operator="equals" value2="CityLink" 
 trueText="Look here to track your order: www.citylinkexample.com/track?=&dollar;CONSIGNMENT_REF" 
 falseText="leave this blank to ignore other couriers" 
 errorText="leave this blank to hide errors"></DECODE>

Note: if using the &dollar;BOXES_CONSIGNMENT_REF tag then the second line above for both <DECODE> options should be:

 trueText="Look here to track your order: &dollar;BOXES_CONSIGNMENT_REF"

This will pull the appropriate Courier URL from [ System Data | Couriers ] and add the consignment reference at the end for each box being shipped. To set this up see How To: Setup Email Consignment References for Boxes.

Setup the Trigger Rule

Email Trigger Rules prompt the system into creating and in some instances automatically sending emails from Khaos Control.

  1. Open an Email Manager screen (show me how).
  2. Click in the Trigger Rules radio button to display existing trigger rules.
  3. Press Ctrl+N or click the New item icon is the button bar's NEW button .
  4. Add the trigger rule code in the Rule Code field.
  5. Add a trigger rule description in the Rule Description field.
  6. Select INVOICE from the Trigger Type drop down.
  7. Select the shipped message template that was created above from the Message Template drop-down.
  8. Tick the 'Send Email Immediately' checkbox if the email is to be automatically sent and not held in the Pending emails section.
  9. Tick the 'Active' checkbox when you wish the Trigger Rule to be enabled.
  10. There are many different ways to setup a shipped rule and they depend on your business processes and the order of stages in the Sales Invoice Manager.
    1. Method One - when an invoice goes from invoicing to a further stage then the email will be created:
      1. Double click on Old Invoice Status to add it to the Active Conditions grid.
      2. Focus in the Comparison column and press =.
      3. Focus in the lookup Value column then press Ctrl+F8 and select orders - invoicing stage.
      4. Double click on New Invoice Status to add it to the Active Conditions grid.
      5. Focus in the Comparison column and press >.
      6. Focus in the lookup Value column then press Ctrl+F8 and select orders - invoicing stage.
    2. Method Two - when an invoice goes from shipping into Issue the email will be created:
      1. Double click on Old Invoice Status to add it to the Active Conditions grid.
      2. Focus in the Comparison column and press =.
      3. Focus in the lookup Value column then press Ctrl+F8 and select orders - Shipping stage.
      4. Double click on New Invoice Status to add it to the Active Conditions grid.
      5. Focus in the Comparison column and press =.
      6. Focus in the lookup Value column then press Ctrl+F8 and select orders - Issue stage.
  11. Press Ctrl+S or click the disk icon is the button bar's SAVE button to save the Trigger Rule. For an example of a trigger rule see example of a Trigger Rule.


See Also


Did you find this article helpful?