Home Forums Pre-Sale Compatibility issue with WooCommerce PDF Vouchers Gift Notification email

Compatibility issue with WooCommerce PDF Vouchers Gift Notification email

  • Author
    Posts
  • #261202

    Omnihyper
    Participant

    Hi VillaTheme Support,

    We are experiencing a compatibility issue between Email Template Customizer for WooCommerce and WooCommerce PDF Vouchers (WPWeb) across multiple production websites.

    Environment
    Email Template Customizer for WooCommerce: v1.3.0 and v1.3.2 (issue occurs in both)
    WooCommerce: 10.8.x
    WooCommerce PDF Vouchers (WPWeb)
    Issue

    WooCommerce PDF Vouchers sends a custom email called:

    woo_vou_gift_notification

    This email is sent to the gift recipient after a voucher purchase.

    When the automatic Gift Notification email is triggered, Email Template Customizer intercepts the email and throws the following fatal error:

    Uncaught TypeError: property_exists(): Argument #1 ($object_or_class) must be of type object|string, array given

    Stack trace:

    VIWEC\INC\Utils::replace_shortcode()
    VIWEC\INC\Email_Trigger->replace_subject()
    Woo_Vou_Gift_Notification->trigger()

    The error occurs because the Gift Notification email passes an array to your shortcode replacement logic, whereas the plugin assumes it has received an object.

    Investigation

    We confirmed the following:

    Stripe payment completes successfully.
    WooCommerce order changes to Processing.
    Customer Processing Order email is sent successfully.
    The Gift Notification email is triggered by WooCommerce PDF Vouchers.
    Manual resend of the Gift Notification works.
    The issue occurs only during the automatic Gift Notification process.

    The Gift Notification email is not listed as a supported email type within Email Template Customizer, so it appears to fall back to the Default Template.

    Temporary workaround

    We found that the failure occurs while processing the email subject.

    In:

    includes/email-trigger.php

    line 156 calls:

    $subject = Utils::replace_shortcode( $subject, [], $object );

    For the Gift Notification email, $object is an array rather than an object.

    As a temporary workaround we modified the code to avoid processing array data in this call, which allowed the Gift Notification email to be generated successfully.

    Additional observation

    After resolving the fatal error, we also found that the Default Template header image had lost its image reference. Re-selecting the image in the Default Template resolved the missing header image issue. This appears unrelated to the fatal error but may be useful for your investigation.

    Request

    Could you please confirm whether WooCommerce PDF Vouchers (Woo_Vou_Gift_Notification) is officially supported?

    If not, would it be possible to update the Default Template fallback so it safely handles custom WooCommerce email types where the email data is supplied as an array instead of an object?

    As this issue affects multiple production websites, we would appreciate any guidance or an official fix.

    Kind regards,

    Albert de Weerd
    OmniHyper

You must be logged in to see replies to this topic. Click here to login or register