Jump to content
  • 0

Payment Reminder Hook AFTER Due Date.


Danse

Question

Hi, 

does anyone has an Hook or Kindly can write a Hook which sends the Payment Reminder Email once AFTER the Due Date? Not before - as like WHMCS Function? 

Its not friendly in my Opinion to send some reminder BEFORE Due Date. 

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0
16 hours ago, Danse said:

does anyone has an Hook or Kindly can write a Hook which sends the Payment Reminder Email once AFTER the Due Date? Not before - as like WHMCS Function? 

Its not friendly in my Opinion to send some reminder BEFORE Due Date.

there is a built in option to send reminders before and/or after due dates - Automation Settings.

https://docs.whmcs.com/Automation_Settings#Overdue_Reminders

Quote

Payment Reminder Emails

When enabled your customers will be reminded by email in advance of an unpaid invoice's due date in line with the Invoice Unpaid Reminder setting. This setting does not apply to Overdue Payment Reminders

Invoice Unpaid Reminder

This email is sent before the due date if the invoice is still unpaid to remind a customer an invoice will soon be due.

Overdue Reminders

If an invoice hasn’t been paid this many days after the due date these emails will be sent to the customer to remind them to pay.

TMqcXpu.png

in the above example, an "Invoice Unpaid Reminder" is sent 7 days BEFORE the due date, and if the invoice is still unpaid, a "First Overdue Reminder" is sent 7 days AFTER the due date.... second & third reminders are not sent as the setting of '0' will disable the feature.

so if you do not want to send a reminder before the due date, simply change the value of "Invoice Unpaid Reminder" in setup -> automation settings to 0 and they will not be sent.

if you want to send reminders after the due date, don't forget that you can also customise the email templates, including changing the subject lines, e.g you can change the subject of the 1st Overdue Reminder to whatever you think is more appropriate.

Link to comment
Share on other sites

  • 0

HI @brian!

the Problem is - I need to have the three given Overdue Reminders for the Dunning. In Germany you have to warn three Times to cancel Service and or give the whole Situation to an Lawyer. 

But before i start the Overdue Emails / Warnings / i want to kindly remember Customer for his Payment. 

I tried to start but obviously i have no clue how to select each Invoice which is overdued and send Emails: 

use WHMCS\Database\Capsule;

if (!defined("WHMCS")) die("Diese Datei kann nicht direkt aufgerufen werden.");

add_hook('DailyCronJob', 1, function ($vars) {

	$messageName = $vars['messagename'];
	$relid = $vars['relid'];
	$templateName = "Invoice Payment Reminder";
	$intervallDaysafter = 2; // two days after DUE send Reminder Email


	/* select invoice */
	$rows = Capsule::table('tblinvoices')->select('id')->WHERE('userid', '<=', $uid)->where('status', '=', 'Unpaid')->count();
		
		foreach(Capsule::table('tblinvoices')->select('duedate')->WHERE('userid', '=', $uid)->where('status', '=', 'Unpaid')->get() as $unpaidinvoice
		{$intervallDaysafter}DAY <= NOW())
			{
			// Send Payment Reminder for Each Invoice which is unpaid. Example: Due Date is 01.01.2018 - send Payment Reminder Email ($intervallDaysafter) two days after 01 Januar 2018
			}

		else (empty($rows))
			{
			// IF no Unpaid - stop
			return;
			}
});

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • 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