Emails are one of the traditional & cheapest ways to send updates to the customers. Today, almost every CMS provides the functionality to engage and stay connected with users via emails. And Magento does the same and provides an email automation system that notifies store customers every time their order status gets updated or changed. Taking it to the next level, Magento also generates and sends order doc PDFs as an email attachment to the customers. So they can have virtual docs of their purchase.
But with the update to Magento 2.3.3, many Magento 2 store owners are facing an issue while sending PDF as an email attachment. It seems like there an issue in their core and one needs to fix it so all the store owners can fix and continue to use their upgraded Magento 2.3.3. So, if you are in search of fixing a PDF attachment issue, your search ends here. Just follow these steps and your email attachment will start working like charm as it worked previously.
First, you need to create “di.xml” file inside your extension folder.

Now, you have to create one more file “transportBuilder.php” inside your template folder with below code.

Lastly, we have create a call to the file as shown below.

That’t it. Now your email attachment issue is resolved. You are free to manipulate this code according to your need.
Lastly, if you found this blog helpful, don’t forget to share it with your colleagues and Magento Friends and Let us know if you are facing any issue while implementing this code.
Happy Coding!

Click to rate this post!
[Total: 13 Average: 5]