Jump to content

actionhook_InvoicePaid Vars Error


Recommended Posts

Hi

 

We have an actionhook for InvoicePaid which has now been migrated to V4.

 

However, $vars["InvoiceID"] now only returns the first digit of the full invoice id number.

 

Does anyone else use this hook and have the same issue?

 

Kind regards

Link to comment
Share on other sites

Ok sorry for the confusion. I suggest creating a single file for each hook. but ti would look like...

 

<?php
function do_something($invoiceid) {
   // You can then use $invoiceid in your code here
}
add_hook("InvoicePaid",1,"do_something","");
?>

Link to comment
Share on other sites

We have an actionhook for InvoicePaid which has now been migrated to V4.

 

However, $vars["InvoiceID"] now only returns the first digit of the full invoice id number.

 

Does anyone else use this hook and have the same issue?

 

Thanks for all your help so far, it seems that your code suffers from the same problem as mine!

 

<?php

function InvoicePaidEmail($invoiceid) {

   # This function runs when an invoice is fully paid

   $to = "info@mydomain.com";
   $from = "info@mydomain.com";
   $subject = "WHMCS Payment Received";

   $headers = "To: ".$to."\n" . 
       "From: ".$from."\n" . 
       "MIME-Version: 1.0\n" . 
       "Content-type: text/html; charset=iso-8859-1";

   $message = "A new payment has been received for Invoice No.".$invoiceid.".";

   mail($to,$subject,$message,$headers);

}

add_hook("InvoicePaid",1,"InvoicePaidEmail","");

?>

The above code returns:

 

A new payment has been received for Invoice No.5.

 

When it should return:

A new payment has been received for Invoice No.5432.

Any ideas?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated