Jafar Muhammed Posted June 13, 2020 Share Posted June 13, 2020 Hello, Is there any way to send an email xx day(s) before WHMCS terminates an overdue service? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 14, 2020 Share Posted June 14, 2020 20 hours ago, Jafar Muhammed said: Is there any way to send an email xx day(s) before WHMCS terminates an overdue service? I would have thought the native way would be to include the message in the most applicable invoice reminder email (1st/2nd/3rd) before your termination date. I suppose an Email Marketer rule could be used because you will know your termination date from the automation settings page, and so therefore you could send an email (T-x) days after the next due date of a service - if the service had been suspended first, then that would make the rule clearer to apply. hooking would be an option, but just remember that overdue isn't an actual status, it's calculated from the NDD based on the invoice settings. 1 Quote Link to comment Share on other sites More sharing options...
ITKoolKidd Posted July 2, 2020 Share Posted July 2, 2020 On 6/14/2020 at 1:25 PM, brian! said: I would have thought the native way would be to include the message in the most applicable invoice reminder email (1st/2nd/3rd) before your termination date. What would be the best way to pull in and display the termination date in the email template? Can we use the invoice_date_due variable and add x days? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 2, 2020 Share Posted July 2, 2020 9 hours ago, ITKoolKidd said: What would be the best way to pull in and display the termination date in the email template? Can we use the invoice_date_due variable and add x days? you mean something like... ? {"$invoice_date_due +15 days"|strtotime|date_format:'%d-%m-%Y'} it should work, but you'd have to add strtotime to the Smarty Security Policy modifiers list otherwise it might not send. the alternative would be a EmailPreSend hook where you queried the database for the due date, did your date calculations on it and then returned it as a custom variable to the template - but if you're comfortable using Smarty in the template, then it's a valid option... though you might need to use the source editor to enter the code. 1 Quote Link to comment Share on other sites More sharing options...
ITKoolKidd Posted July 12, 2020 Share Posted July 12, 2020 Thanks I'll give it a try. 0 Quote Link to comment Share on other sites More sharing options...
Jafar Muhammed Posted July 20, 2020 Author Share Posted July 20, 2020 On 14/06/2020 at 10:55 PM, brian! said: I would have thought the native way would be to include the message in the most applicable invoice reminder email (1st/2nd/3rd) before your termination date. Thank you so much champion, as always. I was derailed a bit, I am sorry for the late response 😊 0 Quote Link to comment Share on other sites More sharing options...
Vox Posted July 23, 2020 Share Posted July 23, 2020 Hi @Jafar Muhammed, On 6/13/2020 at 5:49 PM, Jafar Muhammed said: Is there any way to send an email xx day(s) before WHMCS terminates an overdue service? Clearly I am not an accomplished coder like @brian! (whose code I have used on many occasions) so I would come at this from a different perspective... So, you know when the "due date" was and you know when you will suspend the account from your automation settings ("x" days after suspension). So why not set a rule (or rules) to send the clients notifications "y" days after the due date if their services are currently suspended? I have to use that form of logic because I cannot code!! 😀 0 Quote Link to comment Share on other sites More sharing options...
Jafar Muhammed Posted July 24, 2020 Author Share Posted July 24, 2020 8 hours ago, Vox said: So why not set a rule (or rules) to send the clients notifications "y" days after the due date if their services are currently suspended? That will work, but I haven't done that yet. Instead, I am relying on: On 14/06/2020 at 10:55 PM, brian! said: I would have thought the native way would be to include the message in the most applicable invoice reminder email (1st/2nd/3rd) before your termination date. So as per this native way, I have a total of 5 emails that mention about upcoming Suspension and Termination. If a customer ignore these emails, one more email with the x-rule won't make them pay 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 24, 2020 Share Posted July 24, 2020 16 hours ago, Vox said: Clearly I am not an accomplished coder like @brian! (whose code I have used on many occasions) so I would come at this from a different perspective... competent might be a better adjective, but we'll go with accomplished if you really insist. 😛 16 hours ago, Vox said: I have to use that form of logic because I cannot code!! 😀 don't say that like it's a bad thing - coding in WHMCS should be considered as a last resort... everyone's first thought, when confronted with a customisation issue in WHMCS, should be to think whether it can be achieved by default methods without the need to open up the coding can of worms. sadly, these days a lot of features in WHMCS are just written to work in one way - and you have to take it or leave it, so additional coding has become more widespread to get around the limitations and inflexibility of WHMCS. when I think back to 2013, I don't recall seeing that many hooks posted here, but with the advent of nav hooks and the increasingly closed nature of WHMCS, it's becoming more necessary. 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.