Magento – Magento 2 error: We’re sorry, an error has occurred while generating this email

emailerrormagento2production-mode

I am getting below error in magento 2 local system.

We're sorry, an error has occurred while generating this email.

Best Answer

  1. Enable developer mode using command line php bin/magento deploy:mode:set developer
  2. Clear cache using command line php bin/magento cache:flush
  3. Reload the front end page
  4. After reloading the page the message will change to

Error filtering template: Unable to write file into directory \C:/xampp/htdocs/Magento/pub/media/catalog/product\cache\f073062f50e48eb0f0998593e568d857/m/b. Access forbidden.

  1. Follow this link to fix https://magento.stackexchange.com/questions/170376/magento-2-unable-to-write-file-into-directory-access-forbidden
  2. Clear cache
  3. Reload the front end page again
  4. If you see another message after enabling developer mode you can google it.