• Hi, Recently I’m facing issue on sending all Woocommerce email via mailpoet. This website uses “Woocommerce Subscription” Plugin. So whenever a customer buy a subscription product from the site. After complete the payment, that user automatically registered to the site. But after all the customer and the Admin users not getting any email regarding the successfull Order and Subcription due to an error on Mailpoet plugin. On debug I get that error is – “Fatal error: Uncaught Exception: You should call ‘render’ before ‘getHTMLAfterContent'”. Now I’m not sure why that error appears suddenly after recent plugin update. Also when open the WP site with “Recovery Mode” it PAUSES the Mailpoet plugin due to same error. Here I’m attached the error details-

    Fatal error: Uncaught Exception: You should call 'render' before 'getHTMLAfterContent' in /home/thisiswealthco/public_html/wp-content/plugins/mailpoet/lib/WooCommerce/TransactionalEmails/Renderer.php:66 Stack trace: #0 /home/thisiswealthco/public_html/wp-content/plugins/mailpoet/lib/WooCommerce/TransactionalEmailHooks.php(64): MailPoet\WooCommerce\TransactionalEmails\Renderer->getHTMLAfterContent() #1 /home/thisiswealthco/public_html/wp-includes/class-wp-hook.php(324): MailPoet\WooCommerce\TransactionalEmailHooks->MailPoet\WooCommerce\{closure}(Object(WC_Email_Customer_Invoice)) #2 /home/thisiswealthco/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #3 /home/thisiswealthco/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #4 /home/thisiswealthco/public_html/wp-content/plugins/woocommerce/templates/emails/customer-invoice.php(98): do_action('woocommerce_ema...', Object(WC_Email_Customer_Invoice)) #5 /home/thisiswealthco/public_html/wp-content/plugins/woocommerce/includes/wc-core-functions.php(345): include('/home/thisiswea...') #6 /home/thisiswealthco/public_html/wp-content/plugins/woocommerce/includes/wc-core-functions.php(364): wc_get_template('emails/customer...', Array, '', '') #7 /home/thisiswealthco/public_html/wp-content/plugins/woocommerce/includes/emails/class-wc-email-customer-invoice.php(153): wc_get_template_html('emails/customer...', Array) #8 /home/thisiswealthco/public_html/wp-content/plugins/woocommerce/includes/emails/class-wc-email.php(588): WC_Email_Customer_Invoice->get_content_html() #9 /home/thisiswealthco/public_html/wp-content/plugins/woocommerce/includes/emails/class-wc-email-customer-invoice.php(133): WC_Email->get_content() #10 /home/thisiswealthco/public_html/wp-content/plugins/woocommerce/includes/class-wc-emails.php(378): WC_Email_Customer_Invoice->trigger(1335, Object(Automattic\WooCommerce\Admin\Overrides\Order)) #11 /home/thisiswealthco/public_html/wp-content/plugins/woocommerce/includes/admin/meta-boxes/class-wc-meta-box-order-actions.php(139): WC_Emails->customer_invoice(Object(Automattic\WooCommerce\Admin\Overrides\Order)) #12 /home/thisiswealthco/public_html/wp-includes/class-wp-hook.php(324): WC_Meta_Box_Order_Actions::save(1335, Object(Automattic\WooCommerce\Admin\Overrides\Order)) #13 /home/thisiswealthco/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #14 /home/thisiswealthco/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #15 /home/thisiswealthco/public_html/wp-content/plugins/woocommerce/src/Internal/Admin/Orders/Edit.php(313): do_action('woocommerce_pro...', 1335, Object(Automattic\WooCommerce\Admin\Overrides\Order)) #16 /home/thisiswealthco/public_html/wp-content/plugins/woocommerce/src/Internal/Admin/Orders/Edit.php(153): Automattic\WooCommerce\Internal\Admin\Orders\Edit->handle_order_update() #17 /home/thisiswealthco/public_html/wp-content/plugins/woocommerce/src/Internal/Admin/Orders/PageController.php(350): Automattic\WooCommerce\Internal\Admin\Orders\Edit->setup(Object(Automattic\WooCommerce\Admin\Overrides\Order)) #18 /home/thisiswealthco/public_html/wp-content/plugins/woocommerce/src/Internal/Admin/Orders/PageController.php(366): Automattic\WooCommerce\Internal\Admin\Orders\PageController->prepare_order_edit_form() #19 /home/thisiswealthco/public_html/wp-content/plugins/woocommerce/src/Internal/Admin/Orders/PageController.php(167): Automattic\WooCommerce\Internal\Admin\Orders\PageController->setup_action_edit_order() #20 [internal function]: Automattic\WooCommerce\Internal\Admin\Orders\PageController->handle_load_page_action('') #21 /home/thisiswealthco/public_html/wp-content/plugins/woocommerce/src/Internal/Traits/AccessiblePrivateMethods.php(158): call_user_func_array(Array, Array) #22 /home/thisiswealthco/public_html/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Internal\Admin\Orders\PageController->__call('handle_load_pag...', Array) #23 /home/thisiswealthco/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array) #24 /home/thisiswealthco/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #25 /home/thisiswealthco/public_html/wp-admin/admin.php(237): do_action('load-woocommerc...') #26 {main} thrown in /home/thisiswealthco/public_html/wp-content/plugins/mailpoet/lib/WooCommerce/TransactionalEmails/Renderer.php on line 66

    Please check all details and suggest a solution asap.

    Thanks

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Ojoma a11n

    (@geraltrivia)

    Hello there @iwdatanu ,

    Thank you for reaching out to us.

    Can you kindly run a plugin conflict by following this guide: https://kb.mailpoet.com/article/204-how-to-test-for-plugins-conflic. Kindly leave only WooCommerce and MailPoet active then make a test transaction and see if it works as ex=pected.

    If it doesn’t, kindly try re-installing the MailPoet plugin by going here: https://monitor.mailpoet.com/en-US/app/dlnw/delivery_by_userid

    Looking forward to hearing back from you.

    Thread Starter Atanu

    (@iwdatanu)

    Hi @geraltrivia

    I’ve followed your instruction and going through disable all other plugins except Woocommerce and Mailpoet. But still i getting same issue during Troubleshoot mode. Now there are two lines in error log are –

    [22-Aug-2024 07:10:40 UTC] PHP Warning:  Undefined array key 1 in /home/thisiswealthco/public_html/dev/wp-content/plugins/mailpoet/lib/WooCommerce/TransactionalEmails/Renderer.php on line 54

    [22-Aug-2024 07:10:40 UTC] PHP Warning: Transactional email triggered fatal error for callback woocommerce_email_footer in /home/thisiswealthco/public_html/dev/wp-content/plugins/woocommerce/includes/class-wc-emails.php on line 183

    So, what I can understand that with our mailpoet templates, in the file /plugins/mailpoet/lib/WooCommerce/TransactionalEmails/Renderer.php on line 54 the array key returns nothing for $this->htmlAfterContent = $html[1] in the “render” function. So in the function “getHTMLAfterContent” since that array key value retuns empty so from this function it thrown the error.

    public function getHTMLAfterContent() {
    if (empty($this->htmlAfterContent)) {
    throw new \Exception("You should call 'render' before 'getHTMLAfterContent'");
    }
    return '<!--WooContent--></td></tr></table></div></div></div>' . $this->htmlAfterContent;
    }

    But, if I commented the line number 66, that is “throw new \Exception(“You should call ‘render’ before ‘getHTMLAfterContent'”);” in the function “getHTMLAfterContent“, then all are working fine.

    So please check the issue in detail and suggest a solution asap.

    Plugin Support Dani F. a11n

    (@danielinhou)

    Hi again @iwdatanu,

    Thanks for testing and your feedback. Do I get it right that you are using MailPoet to customize your WooCommerce emails?

    Could you please send (copy & paste) the information from?MailPoet > Help > System Info and delete any sensitive info from it?

    Thread Starter Atanu

    (@iwdatanu)

    Yes, you are right. I’m also using mailpoet for customize Woocommerce Emails. Here is the system info for mailpoet plugin-

    name: [email protected]
    email: [email protected]
    PHP version: 8.1.29
    MailPoet Free version: 5.0.1
    MailPoet Premium version: N/A
    MailPoet Premium/MSS key:
    WordPress version: 6.6.1
    Database version: 8.0.39
    Web server: Apache
    Server OS: Linux server1.inspire.scot 5.14.0-427.28.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Aug 2 03:44:10 EDT 2024 x86_64
    WP info: WP_MEMORY_LIMIT: 40M - WP_MAX_MEMORY_LIMIT: 512M - WP_DEBUG: 1 - WordPress language: en_GB - WordPress timezone: +00:00
    PHP info: PHP max_execution_time: 3000 - PHP memory_limit: 512M - PHP upload_max_filesize: 10M - PHP post_max_size: 128M
    Multisite environment?: No
    Current Theme: Kadence (version 1.2.9)
    Active Plugin names: acf-quickedit-fields/index.php, advanced-custom-fields-pro/acf.php, ameliabooking/ameliabooking.php, disable-admin-notices/disable-admin-notices.php, email-log/email-log.php, events-manager-pro/events-manager-pro.php, events-manager-woocommerce/events-manager-woocommerce.php, events-manager/events-manager.php, favicon-by-realfavicongenerator/favicon-by-realfavicongenerator.php, forminator/forminator.php, health-check/health-check.php, insert-headers-and-footers/ihaf.php, instagram-feed/instagram-feed.php, internetcreation/plugin.php, kadence-blocks-pro/kadence-blocks-pro.php, kadence-blocks/kadence-blocks.php, mailpoet/mailpoet.php, mainwp-child-reports/mainwp-child-reports.php, mainwp-child/mainwp-child.php, metronet-reorder-posts/index.php, oxyextras/oxy-extras.php, oxygen-woocommerce/plugin.php, oxygen/functions.php, post-duplicator/m4c-postduplicator.php, redirection/redirection.php, smtp-mailer/main.php, user-role-editor/user-role-editor.php, user-switching/user-switching.php, wc-thanks-redirect/wc-thanks-redirect.php, webp-express/webp-express.php, woo-checkout-field-editor-pro/checkout-form-designer.php, woo-update-manager/woo-update-manager.php, woocommerce-gateway-gocardless/woocommerce-gateway-gocardless.php, woocommerce-subscriptions/woocommerce-subscriptions.php, woocommerce/woocommerce.php, wordfence/wordfence.php, wordpress-seo/wp-seo.php, wp-defender/wp-defender.php, wp-login-and-logout-redirect/wp-login-logout-redirect.php, wpmudev-updates/update-notifications.php
    Sending Method: SMTP
    Sending Frequency: 25 emails every 5 minutes
    MailPoet sending info: Send all site's emails with: current sending method - Task Scheduler method: Action Scheduler - Cron ping URL: https://thisiswealth.co.uk?mailpoet_router&endpoint=cron_daemon&action=ping - Default FROM address: [email protected] - Default Reply-To address: [email protected] - Bounce Email Address: [email protected]
    Total number of subscribers: 250
    Plugin installed at: 2024-01-22 15:14:42
    Installed via WooCommerce onboarding wizard: false

    Another issue with mailpoet plugin is that when I’ve added multiple recepient in woocommerce emails, then it can not send email to all recepients. It just sending email to the first email only.

    For example – In Woocomerce New Order email settings, I’ve added 3 email ids with comma separated and without any blank spaces. Like – “[email protected],[email protected],[email protected]”. Now the email goes to only first email for a new order. Other two email ids not recieved any kind of woocommerce emails. But when I’ve deactivated the “Mailpoet” plugin. All are working fine as expected.

    Please check detail and provide a solution for all these issues asap

    Plugin Support kellymetal a11n

    (@kellymetal)

    Hi there @iwdatanu,

    I’m also using mailpoet for customize Woocommerce Emails

    Thank you very much for confirming that.

    Our developers have identified an issue related to a change in a recent update of a third-party library used in our email editor, which has been found to cause an issue in some cases when the WooCommerce template customizer is enabled in MailPoet. Specifically, it can happen if the “Auto-generated WooCommerce Content” block in the email editor is placed within a Column block (which is not supposed to be allowed by the editor’s validation, but currently is possible due to the bug). Unfortunately in the editor it’s a bit tricky to drag-and-drop the block out of the column block.

    They are still investigating the best solution moving forward, but in the meantime, one option for resolving the issue would be to do the following to reset the Woo template back to the default state (note you will lose customizations you’ve applied and need to re-apply them afterward):

    1. Access your site’s database, and go to the wp_mailpoet_newsletters table. You can use a plugin like WP phpMyAdmin to access the database, or via your host’s own tools (depending on your host).
    2. Search for the row with type = wc_transactional — example screenshot: https://d.pr/i/ws7EOl
    3. Edit the row, and replace the body with the default code, which you can copy/paste from here: https://d.pr/n/eOP3gu
    4. Save the new value
    5. Go back to the template customizer under MailPoet > Settings > WooCommerce, and re-apply your customizations (adding your logo, adjusting styles, etc)

    Another issue with mailpoet plugin is that when I’ve added multiple recepient in woocommerce emails, then it can not send email to all recepients. It just sending email to the first email only.

    This is related to the fact that our MailPoet Sending Service does not support sending to Multiple TO addresses (or CC, BCC, or file attachments) — this is discussed in our Knowledgebase here: https://kb.mailpoet.com/article/292-choose-how-to-send-your-wordpress-websites-emails#cc

    There’s an open request to add support for this on our ideas board here:
    https://mailpoet.canny.io/feature-requests/p/support-cc-bcc-or-multiple-to

    In the meantime, if you require sending to multiple recipients for those Woo Order emails, it will be necessary to send your transactional emails via your site’s own sending method instead. You can change that under MailPoet > Settings > Advanced with the “Send all site emals with…” setting.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.