Support » Plugin: Woo Custom Emails Per Product » Notice: Undefined variable: output

  • Hey, I have troubles with Assigned messages. There are some for 6 products only, the rest wont upload and therefor doesnt work. Right in the Assigned messages it says: Notice: Undefined variable: output in /home/www/ on line 228
    Line 228 in my case is this one $output .= ‘<div class=”post-count”>’;
    in the “// Create query object.” section.

    Plus, various messages of this kind: Notice: Undefined index: show_in_admin_emails in /home/www/ on line 157
    appear in my customers invoices, which is quite scary both for them and me…
    Thanks in advance for any help and guidance.

    • This topic was modified 6 months, 2 weeks ago by andreaamira.

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author alexmustin


    Hi @andreaamira,

    Thanks for posting this! I did in fact forget to instantiate the variable before using it, causing this error. Oops!

    I can push out an update for this soon today, but in the meantime if you want to fix the problem yourself, you can update Line 192 of the file: /plugins/woocustomemails/admin/class-woo-custom-emails-per-product-admin-settings.php to define the $output variable:

    public function display_wce_assigned_page() {
    	$output = '';

    Please let me know if this resolves your issue.

    Plugin Author alexmustin


    Hi @andreaamira – I have pushed an update for the plugin.

    Please update the plugin and let me know if version 2.2.7 solves your issues.

    Thanks in advance!



    HELLO, I am having the same issue, and I am using version 2.2.7. I try to make the suggested change, however, the code is already there.

    Andreaamira: were you able to fix this??

    Plugin Author alexmustin



    Thanks for using my plugin.

    Is your reported issue also happening on this file and on this line?

    /admin/class-woo-custom-emails-per-product-admin-settings.php on line 228

    Or is your error something else? Can you please copy/paste it here for reference?


    Thread Starter andreaamira


    @jennybertha Hey there, the list of Assigned messages is still not complete (only 6 items are displayed), but all my custom emails are delivered for all items above the list.

    Anyway, the logs (or what it is, like Notice: Undefined index: show_in_admin_emails in /home/www/ on line 157), they still appear in the invoices etc. Its really annoying :/

    Plugin Author alexmustin


    @andreaamira – FYI the “Assigned Messages” feature is working totally fine for me on my local dev environment, but does not work for others.

    The problem with the Assigned Messages page has to do with how many products are published on your site, and how the Messages are saved as meta data with each product — the db query that works fine on my local site is too complex on larger sites, and crashes.

    This means I have to completely re-build the Assigned Messages page, including creating my own database for just this feature. I have no way to tell everyone to stop using it until it works.

    • This reply was modified 4 months ago by alexmustin.
Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.