Jump to content

service renewal confirmation message


Remitur

Recommended Posts

For domain renewal there's a ready message template, which confirm to the customer that the domain has been regularly and successfully renewed...

But... does exist any way to create such a message for the renewal of a service?

It would be useful in a number of different cases... 

 

 

Link to comment
Share on other sites

off-hand, I can't think of a way via the admin settings.... I doubt you could use Marketer for such a purpose.

you could certainly do it with a hook, invoicepaid I suppose, and then just determine if the invoice contains a service that's been renewed and if so, send a specific email template.

one other thought on this, the blog mentioned that in 2019 there will be "On-Demand Renewals Support for Products and Services."... much as there is in the bugged domain renewals option... possibly as part of that feature, that will include a hosting renewal confirmation option ?? unless one of the WHMCS guys confirms what's going to happen, then you might need to wait for the betas to know.

On 17/05/2019 at 17:48, Remitur said:

It would be useful in a number of different cases... 

as I said, it can be done with hooks.

Link to comment
Share on other sites

This hook should work.

<?php

use WHMCS\Database\Capsule;

add_hook('InvoicePaid', 1, function($vars)
{
	// Retreiving Products/Services from the invoice that has been just paid  
	$HostingItems = Capsule::select(Capsule::raw('SELECT t2.id FROM tblinvoiceitems AS t1 LEFT JOIN tblhosting AS t2 ON t1.relid = t2.id WHERE t1.invoiceid = "' . $vars['invoiceid'] . '" AND t1.type  = "Hosting"'));

	// Foreach Product/Service that has been renewed I send the "Product Renewal Confirmation" (read post below for more details)
	foreach ($HostingItems AS $v)
	{
		$postData['messagename'] = 'Product Renewal Confirmation';
		$postData['id'] = $v->id;
		$results = localAPI('SendEmail', $postData);
	}
});

The hook requires an Email Template to send the renewal confirmation via email. Go to Setup > Email Templates and press Create New Email Template with the following settings:

  • Email Type: Product/Service
  • Unique Name: Product Renewal Confirmation
  • Email Title: Product Renewal Confirmation (feel free to change it)
  • Email Body: (see below - Feel free to customize it)
<p>Dear {$client_name},</p>
<p>Thank you for your renewal order. Your renewal request for the product listed below has now been completed.</p>
<p>Product/Service: {$service_product_name} {if $service_domain} ({$service_domain}){/if}<br />Renewal Length: {$service_billing_cycle}<br />Renewal Price: {$service_recurring_amount}<br />Next Due Date: {$service_next_due_date}</p>
<p>You may login to your client area at <a href="{$whmcs_url}">{$whmcs_url}</a> to manage your domain.</p>
<p>{$signature}</p>

Preview:

sample-8.png.feb8aa33eb38e00b18ee282845523635.png

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.

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