3. Define actions for shipment events


In the “Actions” tab under “Track Consignments > Settings” actions can be defined that are executed when a certain event occurs in a shipment. For example, the order status of a WooCommerce order can be automatically changed or emails can be sent when a shipment has arrived at the recipient (or any other event).

 

3.1 When and how often should an action be executed?

First you have to define under “Call event actions” for which tracking numbers and how often an action for an event should be executed. In the first dropdown, three options are available to limit actions to specific tracking numbers of a WooCommerce order. This setting has no effect on WooCommerce orders that only have one tracking number.

 

Possible options for selecting which tracking numbers of an order should be checked:

  • Latest tracking number: In this case, only the last tracking number added to the order is checked and actions performed accordingly.
  • Oldest tracking number: Similar to the “Latest tracking number” option, only the first (oldest) shipment number is checked to trigger actions.
  • All tracking numbers: All tracking numbers associated with a WooCommerce order will be checked and potential actions triggered.

 

In the second dropdown, you can define how often an action should be executed per event (code). The following options are available:

  • Once per Swiss Post event code (for all tracking numbers of an order): An action is carried out at most once per event code per order. Depending on the selection in the first drop-down, the event codes can belong to different tracking numbers.
  • Once per Swiss Post event code and per tracking number of an order: For each tracking number of a WooCommerce order, at most one action per event code is carried out. Multiple actions can therefore be carried out for the same events but for different tracking numbers per order.

 

3.2 Define Actions

In the Actions field, several actions can be defined that are executed as soon as a specific shipment event has occurred. A new event action rule can be defined using the “Add rule” button.

In the Event field of a rule box you can select the event that must occur in order for the actions listed in the same rule box under Actions to be carried out. The following actions are available:

  • WooCommerce order status: The WooCommerce order is set to the selected order status when the event occurs.
  • Send WooCommerce email: The selected WooCommerce email will be sent. Depending on the selected email, it will be sent to the customer or the shop owner.
  • Send custom email: Custom email templates are listed here, which can be defined under “Shipment Tracking > Email templates”. An email is sent according to the settings in the template (see Email templates).
  • Custom action: Selecting this option creates a WordPress action that can be used to react to shipment events using custom programming code (programming knowledge required; see Define custom actions).

All actions are executed in the order in which they appear (from top to bottom). The order can be changed using drag and drop.