How To: Setup Emails Triggered on Sales Order Type

Emails can be triggered if they are of a certain sales order type, for example; sales order, proforma, quotation, return credit and return exchange.

There are two steps to creating emails that are automatically created and sent for specific types of sales orders:

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


  1. The Document Rules generate an email when a customer has the following setup against them:
    1. When the customer's invoice contact has an e-mail address.
    2. If there is no email address for the invoice contact the invoice address' email address will be used.
  2. For an example of the finished screens see Email Sales Order Type Example.

The example below is for a new quotation, the email will be sent when the quotation is saved.

Setup the Message Template

  1. Open an Email Manager screen (show me how).
  2. Click in the Message Templates radio button.
  3. Press Ctrl+N or click the New item icon is the button bar's NEW button .
  4. In the Setup area:
    1. Add a template code in the 'Template Code'.
    2. Add a template description in the 'Template Desc' field.
    3. Select the 'INVOICE' from the Trigger Type drop-down.
    4. Add email addresses in the 'CC List' and/or 'BCC List' fields if required.
  5. In the Options area:
    1. Tick the 'Use Brand Email Address' checkbox if associating the brand with the quotation.
      Note: the brand email address is setup against the brand in [ System Data | Sales Order Processing | Branding ].
    2. Tick the 'Show Pack Children' checkbox if pack children should be displayed in the email body if you are including the stock items on the quote in the body of the email.
    3. 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.
    4. Tick the HTML Format checkbox if the email is to be formatted using HTML.
      Note: for formatting the email body including adding images, for example the brand logo, see How To: Insert an Image into an Email.
  6. In the Template area:
    1. If not using the brand email address or wishing to override the default email address enter the email address in the 'From' field.
    2. Add a 'Subject' for the email, for example Thank you for your quotation.
      Note: you can add tags into the Subject area by selecting them and using the upper BtnEmailArrow.jpg button, for example adding the sales order code.
    3. If you wish to include the stock items on the quotation in the body of the email enter 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.
    4. 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 the example of a message template for a new quotation.
  7. Add the yellow $ITEM_TEXT tag where you wish the list of items being shipped to be placed in the email body.
  8. 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 sales order type message template example.

Setup the Trigger Rule

Email Trigger Rules prompt the system into creating and in some instances automatically sending emails from Khaos Control.
Note: each condition MUST be true at the same time in order for the rule to work.

  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. In the Setup area:
    1. Add the trigger rule code in the Rule Code field.
    2. Add a trigger rule description in the Rule Description field.
    3. Select INVOICE from the Trigger Type drop down.
    4. Select the message template that was created above from the Message Template drop-down.
    5. Tick the Send Email Immediately checkbox if the email is to be automatically sent and not held in the Pending emails section.
    6. Tick the Active checkbox when you wish the Trigger Rule to be enabled.
  5. There are many different ways to setup the triggers, below is an example of setting up a trigger so that when a sales order is of type 'Quotation' and it is first saved, then send an email:
    1. Focus on SOrder Type and click on the Email Add button button to add it to the Active Conditions grid.
    2. Focus in the Comparison column and enter =.
    3. Focus in the lookup Value column then press Ctrl+F8 and select Quotation stage.
  6. 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 quotation rule example with one condition.

Did you find this article helpful?