1 |
PHP Fatal error: Uncaught TypeError: Argument 1 passed to Magento\Email\Model\Template::setVars() must be of the type array, null given |
Above Error throwing due to adding comma separated email in Sales Emails > Order > order copy
check the below screenshot for reference:
It has the issue with the file which has below path
vendor/magento/module-sales/Model/Order/Email/SenderBuilder.php
Please override the above file by
Replacing this Function :
1 2 3 4 5 6 7 8 9 10 11 12 13 |
public function sendCopyTo() { $copyTo = $this->identityContainer->getEmailCopyTo(); if (!empty($copyTo) && $this->identityContainer->getCopyMethod() == 'copy') { $this->configureEmailTemplate(); foreach ($copyTo as $email) { $this->transportBuilder->addTo($email); $transport = $this->transportBuilder->getTransport(); $transport->sendMessage(); } } } |
With :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
public function sendCopyTo() { $copyTo = $this->identityContainer->getEmailCopyTo(); if (!empty($copyTo) && $this->identityContainer->getCopyMethod() == 'copy') { foreach ($copyTo as $email) { $this->configureEmailTemplate(); $this->transportBuilder->addTo($email); $transport = $this->transportBuilder->getTransport(); $transport->sendMessage(); } } } |
That’s It! Now you can add multiple emails with comma-separated.
Please let me know your thought if this blog is helpful to You.
If you want get query string params in controller file,...
Create di.xml and add the below code Magemonkey/Redirect/etc/frontend/di.xml [crayon-6287672b14a06100149836/] Create...
You can try below code to change local date to...
Step 1: First you need to add registration.php file in...
Step1 : Override message.js in current theme file on the...