Thumbnail for Email templates

X-Admin

New Member
Hi,

I've noticed that Email thumbnails generated are from centre-centre of the email, so the centre of the email body is visible in the thumbnail. This doesn't look nice. Just wondering if it's possible to generate thumbnails for top-centre of the email template, so the header etc will be visible and would look better?

1768952923548.png

Cheers!
 
@X-Admin - from next version, you can use a code like below in apps/init-custom.php:
PHP:
hooks()->addFilter('image_helper_resize_email_template_screenshot', function (bool $resized, ImageResizeHookParams $params): bool {
    if ($resized) {
        return true;
    }
    
    $thumb = new PHPThumbGD($params->getSource());
    $thumb->crop(0, $params->getWidth(), $params->getWidth(), $params->getHeight());

    $thumb->save($params->getDestination());
    
    return true;
});
You can use any image resize library you wish, in my example I used ( because it comes with MailWizz 2.x while MailWizz 3.x will use https://image.intervention.io/v3
Maybe not the best way, but still better than nothing.
 
Back
Top