Attaching labels to emails


Labels can be sent as email attachments in two different ways:

  1. As an attachment to WooCommerce emails.
  2. As an attachment to a custom email template to one or more recipients.

 

1. Labels attached to WooCommerce emails

Under “Barcode > Settings > Attach labels to WooCommerce emails” it can be defined to which WooCommerce emails Barcode labels should be attached as a file (PDF, PNG). The files are only attached if Barcode labels already exist or if labels are automatically created when a WooCommerce order is set to the appropriate status (see Automation).

Emails marked as “Admin” are sent to the website administrator. Emails marked as “customer” are sent to the customer of the WooCommerce order.

 

2. Labels attached to custom emails

In the “E-Mails” tab under “Barcode > Settings” several recipients can be inserted in the field “Send labels” to which an email will be sent each time a label is created. If multiple email addresses are entered, they must be separated with a semicolon (;).
Example: number1@test.ch; number2@test.ch

The content of the email can be defined in the fields “Subject”, “Heading” and “Message”. The heading appears at the top of the body of the email. If WooCommerce is active, the heading will be displayed in the style of the WooCommerce title.

For the content (“message”) multiple shortcodes and tags can be used to dynamically insert content.

WooCommerce tags:

All WooCommerce functions of WC_Order that are returned as String, Float or Int can be used. The first part “get_” of the function name has to be removed in order to get the tag name. The following tags (and more) are available:

  • {wc_order_id} oder {id} : Die WooCommerce oder ID.
  • {formatted_order_total} : Formatted total.
  • {cart_tax} : Tax of the cart.
  • {currency} : Currency as ISO code (e.g. CHF).
  • {discount_tax} : Tax of the discounts.
  • {discount_to_display} : Formatted total of the discounts.
  • {discount_total} : Total of the discounts.
  • {shipping_tax} : Shipping tax
  • {shipping_total} : Shipping total
  • {subtotal} : Subtotal (before discounts, but with localised taxes)
  • {subtotal_to_display} : Formatted subtotal.
  • {total} : Order total.
  • {total_tax} : Total tax.
  • {total_refunded} : Total of the refunds.
  • {total_tax_refunded} : Total taxes of the refunds.
  • {total_shipping_refunded} : Total of the refunded shipping costs.
  • {formatted_billing_address} : Formatted billing address.
  • {formatted_billing_full_name} : Formatted name of the invoice recipient.
  • {formatted_order_total} : Formatted order total.
  • {formatted_shipping_address} : Formatted shipping address.
  • {formatted_shipping_full_name} : Formatted name of the recipient.

 

Shortcodes:
  • [mame_bc_tracking_code order_id="" before="" after="" item_before="" item_after="" separator=", " link="true"] : Inserts all tracking codes connected to the WooCommerce order. All arguments are optional:
    • order_id : The WooCommerce order ID of the tracking code to insert. If not set, the current order will be used (i.e. the one connected to the label).
    • before : HTML to insert before the content.
    • after : HTML to insert after the content.
    • item_before : HTML to insert before each tracking code.
    • item_after : HTML to insert after each tracking code.
    • separator : HTML Between each tracking code.
    • link : one of true|false. If set to true, the tracking code is output as link, otherwise the tracking code will be output as text.