Preview:
protected function sendPassMail($order) {
    // Gathering values for mail.
    $langcode = $order->getCustomer()->getPreferredLangcode();
    $client = $order->getCustomer()->name->value;
    $shipping_information = \Drupal::service('commerce_shipping.order_shipment_summary')->build($order);

    $body = [
      '#theme' => 'linker_order_pass',
      '#order' => $order,
      '#shipping_information' => $shipping_information,
    ];

    $params = [
      'headers' => [
        'Content-Type' => 'text/html; charset=UTF-8;',
        'Content-Transfer-Encoding' => '8Bit',
      ],
      'id' => 'linker_order_pass',
      'langcode' => $langcode,
      'subject' => $client . ' issued the order ' . $order->id(),
      'body' => $body,
    ];

    $this->mailManager
      ->mail('bb2b_linker', $params['id'], 'bestellung@bescool.net', $params['langcode'], $params);
  }

// DI za mailManager-a.

/**
   * The mail manager.
   *
   * @var \Drupal\Core\Mail\MailManagerInterface
   */
  protected $mailManager;

downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter