RFEHosting Posted November 1, 2019 Share Posted November 1, 2019 I am looking for a way to send an email to a 3rd party when a specific product type's invoice has been paid. for example, When a client pays their due invoice for their VPS/Server plan, id like to send an email to another email address with the VPS plan's hostname/ip address. What is the best way to do this? A hook when an invoice is paid based on the product type of VPS/Server? Or a WHMCS notification via email using API and a custom api trigger using a email notification template? Thanks 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted November 1, 2019 Share Posted November 1, 2019 (edited) On InvoicePaid run a query to scan the invoice looking for product IDs you need: SELECT id FROM tblhosting WHERE packageid IN ('1', '2', '3') LIMIT 1 Replace 1, 2 and 3 with IDs of your VPS/Server plans. If the query returns true you could SendEmail via API but the problem is that it doesn't let you specify a recipient. You have to autoload PHPMailer, load your SMTP settings from tblconfiguration, retreive the recepient and send the email. In this post I have already described this approach. I know it's boring but there's no other way 🙂 Edited November 1, 2019 by Kian 0 Quote Link to comment Share on other sites More sharing options...
RFEHosting Posted November 1, 2019 Author Share Posted November 1, 2019 Sent you a message, ive love to hear back from you if you have time 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.