Context variables

Available context variables in your template

The following variables are available in the template:

Shipment

The shipment (also called order) the template is used for.
Can be accessed via the shipment variable.

Attributes

  • destinationAddress Address
  • destinationCompany String
  • destinationName String
  • invoiceNumber String
  • shipmentItems list[ShipmentItem]

📘

Accumulated Fields

For the total price, you can use the total_price filter.
For the total weight, you can use the total_weight filter.

Shipment Item

Details about the items included in the shipment.
Can be accessed via the shipment.shipmentItems variable.

Attributes

  • amount Integer
  • customsTariffNumber String
  • price Price
  • productName String
  • sku String
  • weight Float

📘

Filters

You can use the format_price filter to format the price.
You can use the format_weight filter to format the weight.

Sender Address

The address of the warehouse from where the shipment will be sent.
Can be accessed via the senderAddress variable

Read Address for more details about the attributes.

Address

Holds address information such as street, house number etc.

Attributes

  • country Country
  • locality String
  • postalCode String
  • thoroughfare String
  • subThoroughfare String
  • subSubThoroughfare String

📘

Formatting Address

For street, house number and addition use the format_street filter.