Set a placeholder for Pending invoice notifications

Discussion in 'Customization & add-ons' started by gogoseo, Dec 27, 2012.

  1. gogoseo

    gogoseo Member

    Joined:
    Nov 17, 2012
    Messages:
    36
    Hello,

    i managed to maka a placeholder for signup email.
    But how to make one for "Pending invoice notifications to user" email?

    For signup email i use the hook
    Am_Di::getInstance()->hook->add(Am_Event::MAIL_TEMPLATE_BEFORE_PARSE, 'siteMailTemplateBeforeParse');
    it looks like this dosnt seen to work for pending invoice notifications...
  2. gogoseo

    gogoseo Member

    Joined:
    Nov 17, 2012
    Messages:
    36
    Ok. After taking a second look, it seems that the problem is with the getInvoice(); function that is not working(not returning an object) when called at the time of "pending_to_user" email(sending email immediately after the user chooses the "offline payment" type of payment. Is there a special way to get the invoice at this time?
  3. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Actually Invoice should be available in that notification. Can you provide exact hook code?
  4. gogoseo

    gogoseo Member

    Joined:
    Nov 17, 2012
    Messages:
    36
    Ok, i asked the same in support desk and got a really helpful response.

    The problem was that I was accessing the invoice like that:
    $p = $tmp['payment'];
    $invoice = $p->getInvoice();
    ...but at that time of pending invoice emails"...if ($config['name'] == 'pending_to_user').... "there was no payment, so i needed to change to this:
    $invoice = $tmp['invoice'];
    ...

Share This Page