Forum Replies Created

Viewing 1 replies (of 1 total)
  • Hi Guys,

    I managed to solve this by turning the image into BASE64 code and including it into the PDF.

    What I have done (all changes are in file mail-template.php):
    – I added this code to load the image into base64:

    $woocommerce_gift_coupon_logo_type = pathinfo($woocommerce_gift_coupon_logo, PATHINFO_EXTENSION);
    $woocommerce_gift_coupon_logo_data = file_get_contents($woocommerce_gift_coupon_logo);
    $woocommerce_gift_coupon_logo_base64 = 'data:image/' . $woocommerce_gift_coupon_logo_type . ';base64,' . base64_encode($woocommerce_gift_coupon_logo_data);
    

    Then I updated the image rendering by deleting

    $email .= '<img src="' . $woocommerce_gift_coupon_logo . '" width="190" />';

    and adding this instead

    $email .= '<img src="' . $woocommerce_gift_coupon_logo_base64 . '" width="190" />';

    I hope this helps someone else than me 😉

    • This reply was modified 7 years, 5 months ago by Dezzy. Reason: Styling
Viewing 1 replies (of 1 total)