Mail Templates - Show Order Employee Details
It should be possible to show the first and last name of the order employee in mail templates - just like order confirmation.
Not enough interest
We’re closing this idea because it has not received significant interest or activity over the past 12 months. This helps us keep the idea portal focused on the topics that are most relevant to our community.
Thank you for taking the time to submit and support it. We’ll continue to monitor customer needs and may reconsider the topic if interest grows in the future.
-
Patrick Lorenz
commented
Workaround: Load orderEmployee Extension for Email Templates
Problem: The orderEmployee extension from Shopware Commercial B2B is not automatically loaded when rendering order confirmation emails, even though it's available for storefront order views via OrderRouteRequestSubscriber.
Solution: Create a MailService decorator that intercepts email sending and loads the missing extension before template rendering.
and the use this in the 'Email Template':
{% if order.extensions.orderEmployee is defined and order.extensions.orderEmployee|length > 0 %}
{% set orderer = order.extensions.orderEmployee|first %}
{{ orderer.firstName }} {{ orderer.lastName }}
{% else %}
{{ order.orderCustomer.firstName }} {{ order.orderCustomer.lastName }}
{% endif %}Hint: use addExtension() instead of replacing the entire order entity to avoid serialization issues