Preview:
/**
 * Implements hook_mail().
 */
function bb2b_linker_mail($key, &$message, $params) {
  switch ($key) {
    case 'commerce_tracking_code':
    case 'linker_order_rejected':
    case 'linker_order_returned':
    case 'linker_order_not_pass':
    case 'linker_order_pass':
      /** @var \Drupal\Core\Render\RendererInterface $renderer */
      $renderer = \Drupal::service('renderer');

      if (isset($params['headers'])) {
        $message['headers'] = array_merge($message['headers'], $params['headers']);
      }
      if (!empty($params['from'])) {
        $message['from'] = $params['from'];
      }
      $message['subject'] = $params['subject'];
      $message['body'][] = $renderer->render($params['body']);
      break;
  }
}
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