Jump to content


How to Programmatically Attach PDF File in Magento 2 Email

magento magento 2 magento 2 development magento 2 tutorial ecommerce attach pdf in magento 2 email magento ecommerce magento 2 ecommerce

  • Please log in to reply
No replies to this topic

#1 Meetanshi


    Advanced Member

  • Members
  • PipPipPip
  • 122 posts

Posted 13 March 2019 - 11:07 AM

For Magento 2 stores, generally, Emails are sent for various purposes such as invoice, billing, coupon codes, etc. that require to attach PDF files. Manually attaching files for these tasks is not feasible. Instead, programmatically attach a PDF file in Magento 2 Email!

Method to Programmatically Attach PDF File in Magento 2 Email:
  1. Create your TransportBuilder class, Vendor/Extension/Model/Mail/TransportBuilder.php

  2. Create sample Email Sending Helper, Vendor/Extension/Helper/Data.php

For the detailed method, visit https://meetanshi.com/blog/programmatically-attach-pdf-file-in-magento-2-email/

looking for the best presta addons with outstanding support? check this: PrestaShop Modules

Also tagged with one or more of these keywords: magento, magento 2, magento 2 development, magento 2 tutorial, ecommerce, attach pdf in magento 2 email, magento ecommerce, magento 2 ecommerce

IPB Skin By Virteq