Remitur Posted May 17, 2019 Share Posted May 17, 2019 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... 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 19, 2019 Share Posted May 19, 2019 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. 1 Quote Link to comment Share on other sites More sharing options...
Kian Posted May 25, 2019 Share Posted May 25, 2019 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: 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.