Jump to content
Jafar Muhammed

Send an Email Before Service Termination

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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 😊

Share this post


Link to post
Share on other sites

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!! 😀 

 

Share this post


Link to post
Share on other sites
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 

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
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