SendMailActionDecorator in Shopware 6 Commercial Plugin should check if flow has "employee" of specific type
In the shopware commercial plugin, the class src/B2B/EmployeeManagement/Domain/Flow/SendMailActionDecorator.php decorates the SendMailAction. However, in the handleFlow() method it only checks if a flow has the data "employee", but does not further check, if said employee is actually of the type as is implemented by the commercial plugin before assigning languageId etc. to the flow's Context.
This results in any plugin, that also implements their own employee system or simply uses flows that also contain an "employee", but don't have a languageId implemented on it, can not send any mails out, as the decorated handleFlow will never actually be run.
A simple if ( $employeem instanceof EmployeeEntity) statement surrounding the "$flow->getContext()->assign()" should fix this.
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.