0

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

Pranav Patel
  • 154
  • 16

1 Answers1

1

Did you check the plugin that always fired when email sent. Magento/Email/Model/Plugin/WindowsSmtpConfig.php and app/code/Magento/Email/Model/Template/SenderResolver.php

Alex O
  • 1
  • 1
  • Thanks, Саша Осадчий. I fixed that by overriding /Model/Order/Email/OrderSender.php and /Model/Order/Email/SenderBuilder.php , accepted your answer also... :) – Pranav Patel Oct 27 '17 at 05:30