Jump to content

action hook doesn't work

Recommended Posts

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?

Link to comment
Share on other sites

function send_reminder($vars)


$invoiceid = $vars['invoiceid'];
$type = $vars['type'];

logActivity('sendReminder:'.$invoiceid.' '.$type);	

	$title="2e Betalingsherinnering:";
	$title="3e Betalingsherinnering:";
	$title="Laatste herinnering!";

   $_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

 // Set Mollie.nl username and password
 $sms->setLogin('........', '........');
 // Set originator
 // Add recipient(s)

 // Send the SMS Message
 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());




Thanks for your help!

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.

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