dotmailer / dotmailer-magento2-extension

The official Dotdigital for Magento2 extension
https://dotdigital.com/integrations/magento
MIT License
48 stars 64 forks source link

TemplatePlugin assumes every DotDigital Email Template is compressed #586

Closed CsSatter closed 1 year ago

CsSatter commented 2 years ago

Since the release containing https://github.com/dotmailer/dotmailer-magento2-extension/commit/59d9884eacc51f43fdd564d7c9678c68881b8405 the TemplatePlugin no longer checks wether a template is compressed or not. In the case of an uncompressed email template that has had a DotDigital email template mapped to it in the past it'll result in Exceptions being thrown for the end user (Magento Reports).

I understand the commit in the sense that we want to avoid using @ in our code, however removing the isStringCompressed method in the TemplatePlugin has resulted in the issue mentioned above. Syncing the Templates from DotDigital won't solve the issue as the affected Email Templates are no longer mapped to DotDigital Email Campaigns, at the same time they still have their DotDigital Email Campaign ID worked into the Template Code meaning they will pass the isDotmailerTemplate check from the Dotdigitalgroup\Email\Helper\Transactional class and thus resulting in gzuncompress data errors.

sta1r commented 2 years ago

Hi there @CsSatter the uncompressed templates must have been synced/mapped a long time ago. Does the exception get thrown when you try viewing an uncompressed template in the Magento admin?

You may have to manually purge any templates that aren't mapped, but this can be done from Marketing > Email Templates.