- Issue created by @rhovland
- Status changed to Postponed: needs info
over 1 year ago 10:39am 17 June 2023 - π¬π§United Kingdom adamps
Thanks for the report. Please describe exactly what you did, what you saw, and what you expected to see.
- πΊπΈUnited States rhovland Oregon
Added further explanation and tested in a base install with only commerce and symfony_mailer
- πΊπΈUnited States djween
I am experiencing same as rhovland. The emails render the value for the "Order Log" field whether I have any display items fields enabled or not in the manage display tab for my order type.
- πΊπΈUnited States djween
I even removed the body element and assumed it would revert back to using commerce's template (commerce-order-receipt.html.twig). However it did not. When an order confirmation email gets sent it still renders in the email the values from order.activity. This is an issue in of itself as this is admin data exposed to non-admin users via the email.
- πΊπΈUnited States djween
It is happening when I have the {{ body }} tag in the body element. Not sure how to pull in the display fields from 'Order Types > Edit Default > Manage Display > Email' in to the body element. Using {{ body }} in the mailer policy is just pulling in order.activity but that is not being referenced from the manage display fields and the manage display fields that are enabled aren't being pulled in to the email.
- π©πͺGermany Anybody Porta Westfalica
Isn't this a problem / feature request in Drupal commerce, that needs a setting to select the view mode for order confirmation emails? Falling back to default, if none set?
- π©πͺGermany Anybody Porta Westfalica
I created an issue for that, as we ran into the same issue: β¨ Add a view mode selection for commerce order confirmation emails (by order type) Active Still I'm not sure, if we're all taking about the same thing.
If yes, please move this over to commerce and close this as duplicate. - π¬π§United Kingdom adamps
β¨ Add a view mode selection for commerce order confirmation emails (by order type) Active was closed by the maintainer because by default Commerce doesn't use an entity view mode to create the emails.
This issue is about the case where the commerce order override is enabled (see IS point 3), which changes everything. Now the emails are built using an entity view. The variable
{{ body }}
will be replaced with the order entity rendered using the "email" view mode. Is it possible that the people seeing this bug are changing the wrong view mode?? (This module creates that view mode via the fileconfig/mailer_override/core.entity_view_mode.commerce_order.email.yml
.)Ah no but #9 is very clear, it mentions 'Order Types > Edit Default > Manage Display > Email'
NB The "Order items" field defaults to use the "Order Item Table" formatter, which gets its output from a view. If you have strange unexpected markup then perhaps it comes from this view??