I want to use custom sent from name and email id into the order email templates basis on some condition, if order mets with a condition Sender name and Sender email will be set different and shown into the email received but when the condition fails, default Sales Representative name and email will be sent in order emails. Any idea how can I implement into Magento2,
I have debugged into following classes but seems not helped. /var/www/html/pssl/vendor/magento/module-sales/Model/Order/Email/SenderBuilder.php
protected function configureEmailTemplate() { $this->transportBuilder->setTemplateIdentifier($this->templateContainer->getTemplateId()); $this->transportBuilder->setTemplateOptions($this->templateContainer->getTemplateOptions()); $this->transportBuilder->setTemplateVars($this->templateContainer->getTemplateVars()); echo $this->identityContainer->getEmailIdentity();exit; $this->transportBuilder->setFrom($this->identityContainer->getEmailIdentity()); }
function I am trying to debug but no luck