steven-one Posted January 2, 2012 Share Posted January 2, 2012 InvoicePaymentReminder Action Hook doesn't work and I don't know why. When I use ContactEdit the script works, but when I use the InvoicePaymentReminder it doesn't. How is that possible? Today the cronjob sent a reminder mail but the activitylog doesn't show anything. Is it possible to have more action hooks in one file or is that the reason why it doesn't work? 0 Quote Link to comment Share on other sites More sharing options...
tsiedsma Posted January 2, 2012 Share Posted January 2, 2012 Can you post your code so we can better help you troubleshoot the issue? 0 Quote Link to comment Share on other sites More sharing options...
steven-one Posted January 4, 2012 Author Share Posted January 4, 2012 function send_reminder($vars) { require("includes/class.mollie.php"); $invoiceid = $vars['invoiceid']; $type = $vars['type']; logActivity('sendReminder:'.$invoiceid.' '.$type); if($type=="reminder"){ $title="Betalingsherinnering:"; } elseif($type=="firstoverdue"){ $title="2e Betalingsherinnering:"; } elseif($type=="secondoverdue"){ $title="3e Betalingsherinnering:"; } elseif($type=="thirdoverdue"){ $title="Laatste herinnering!"; } else{ $title="Betalingsherinnering:"; } $_query = " SELECT i.total, c.value AS number FROM tblinvoices i, tblcustomfieldsvalues c WHERE i.id=$invoiceid AND fieldid=11 AND relid=i.userid AND (SELECT value FROM tblcustomfieldsvalues WHERE fieldid=12 AND relid=i.userid) ='Ja'"; $data = full_query($_query); $result = mysql_fetch_array($data); if(is_numeric(str_replace(".","",$result[0])) && is_numeric($result[1])) { $bedrag = $result[0]; $nummer = $result[1]; $txt = $title." Factuur: #" . $invoiceid . " Bedrag: " . $bedrag . " EUR"; $sms = new mollie(); // Choose SMS gateway $sms->setGateway(2); // Set Mollie.nl username and password $sms->setLogin('........', '........'); // Set originator $sms->setOriginator('......'); // Add recipient(s) $sms->addRecipients($nummer); // Send the SMS Message $sms->sendSMS($txt); if ($sms->getSuccess()) { logActivity('<b>SMS bericht verzonden naar: '. $nummer .'</b><br />SMS text:<br/>'.$txt); } else { logActivity('<b>SMS verzenden is mislukt!</b><br> Errorcode: ' . $sms->getResultCode() . '<br> Error: ' . $sms->getResultMessage()); } } } add_hook("InvoicePaymentReminder",1,"send_reminder"); ?> Thanks for your help! 0 Quote Link to comment Share on other sites More sharing options...
tsiedsma Posted January 5, 2012 Share Posted January 5, 2012 What version of WHMCS are you using? are you sure require("includes/class.mollie.php"); is a valid location? Try this instead: require_once(ROOTDIR . "/includes/class.mollie.php"); 0 Quote Link to comment Share on other sites More sharing options...
steven-one Posted January 10, 2012 Author Share Posted January 10, 2012 Well.. it works when I change the actionhook to ClientEdit. I´ve version 5.0.2. Couldn´t find any bugfixes about ClientEdit actionhook.. 0 Quote Link to comment Share on other sites More sharing options...
steven-one Posted January 10, 2012 Author Share Posted January 10, 2012 I meant about InvoicePaymentReminder actionhook 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.