Vertical Alignment of Billing and Shipping Addresses stripped

Created on 27 September 2024, 3 months ago

Describe your bug or feature request.

Currently it looks like Drupal Core is stripping the vertical-align: top style from the tr that contains the Shipping and Billing information in
modules/order/templates/commerce-order-receipt.html.twig
This doesn't occur when triggered as admin via the Resend Receipt.

Initially I thought this might be happening at the mail client level but have stepped through using XDebug and can see the style stripped in the generated twig template which is being rendered.

If a bug, provide steps to reproduce it from a clean install.

I was able to reproduce from the command line using drush using the following:

$order_storage = \Drupal::entityTypeManager()->getStorage('commerce_order');
$order = $order_storage->load(<orderid>);
$receipt_mailer = \Drupal::service('commerce_order.order_receipt_mail');
$receipt_mailer->send($order, $order->getEmail(), 'test@example.com');

Where the orderid was for an existing order with both shipping and billing address details - note running this does trigger a resend of that receipt.

Running the code that is used from the resend receipt form -> $resend_mailer->send($order, NULL, NULL, TRUE);

Yields the same result - suggesting that this is a result of twig filters being applied.

I found reports of table inline styles being stripped here: https://stackoverflow.com/questions/60821014/drupal-8-stripping-style-at...

However there are other in line styles in use in this template. Shifting the style from the row to the cell (td) mean that the style wasn't stripped.

🐛 Bug report
Status

Active

Version

3.0

Component

Order

Created by

🇳🇿New Zealand luke.stewart

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024